diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 3349e4860..7e81790e6 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -481,15 +481,11 @@ func (c *GitCommand) Diff(file File) string { // if the file is staged and has spaces in it, it comes pre-quoted fileName = c.OSCommand.Quote(fileName) } - deletedArg := "" - if file.Deleted { - deletedArg = "--" - } - trackedArg := "" + trackedArg := "--" if !file.Tracked && !file.HasStagedChanges { trackedArg = "--no-index /dev/null" } - command := fmt.Sprintf("%s %s %s %s %s", "git diff --color ", cachedArg, deletedArg, trackedArg, fileName) + command := fmt.Sprintf("%s %s %s %s", "git diff --color ", cachedArg, trackedArg, fileName) // for now we assume an error means the file was deleted s, _ := c.OSCommand.RunCommandWithOutput(command)