def METHOD_NAME(self, diffspec: str, relative_to: PurePath | str | None = None) -> set[str]:
    relative_to = PurePath(relative_to) if relative_to is not None else self.worktree
    cmd = ["diff-tree", "--no-commit-id", "--name-only", "-r", diffspec]
    files = self._git_binary._invoke_unsandboxed(self._create_git_cmdline(cmd)).split()
    return {self._fix_git_relative_path(f.strip(), relative_to) for f in files}