def METHOD_NAME(
    self,
    from_commit: str | None = None,
    include_untracked: bool = False,
    relative_to: PurePath | str | None = None,
) -> set[str]:
    relative_to = PurePath(relative_to) if relative_to is not None else self.worktree
    rel_suffix = ["--", str(relative_to)]
    uncommitted_changes = self._git_binary._invoke_unsandboxed(
        self._create_git_cmdline(
            ["diff", "--name-only", "HEAD"] + rel_suffix,
        )
    )
    files = set(uncommitted_changes.splitlines())
    if from_commit:
        # Grab the diff from the merge-base to HEAD using ... syntax.  This ensures we have just
        # the changes that have occurred on the current branch.
        committed_cmd = ["diff", "--name-only", from_commit + "...HEAD"] + rel_suffix
        committed_changes = self._git_binary._invoke_unsandboxed(
            self._create_git_cmdline(committed_cmd)
        )
        files.update(committed_changes.split())
    if include_untracked:
        untracked_cmd = [
            "ls-files",
            "--other",
            "--exclude-standard",
            "--full-name",
        ] + rel_suffix
        untracked = self._git_binary._invoke_unsandboxed(
            self._create_git_cmdline(untracked_cmd)
        )
        files.update(untracked.split())
    # git will report changed files relative to the worktree: re-relativize to relative_to
    return {self._fix_git_relative_path(f, relative_to) for f in files}