Chat tools: argument validation, replace, file snapshots, server-fetched images, show_run, show_diff head/paths, schedule_followup
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,15 +20,15 @@ type gitDiffEntry struct {
|
||||
// work tree against it; two: those commits) plus, when includeUntracked, the
|
||||
// untracked files Git does not ignore, and reads each file's patch within the
|
||||
// show_diff bounds.
|
||||
func collectGitDiff(git gitRunner, revisions []string, includeUntracked bool) (*protocol.StageFileChanges, error) {
|
||||
func collectGitDiff(git gitRunner, revisions []string, includeUntracked bool, pathspecs []string) (*protocol.StageFileChanges, error) {
|
||||
nameArgs := append([]string{"diff", "--name-status", "-z", "--no-renames"}, revisions...)
|
||||
names, err := git.output(append(nameArgs, "--")...)
|
||||
names, err := git.output(append(append(nameArgs, "--"), pathspecs...)...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
entries := parseNameStatus(names)
|
||||
if includeUntracked {
|
||||
others, err := git.output("ls-files", "--others", "--exclude-standard", "-z")
|
||||
others, err := git.output(append([]string{"ls-files", "--others", "--exclude-standard", "-z", "--"}, pathspecs...)...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user