summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-17 22:25:53 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-08-17 22:25:53 +1000
commit03a7e32694216ae4e7b3150a0f6305a960a7980d (patch)
tree235b3fd488f5e779c21e3d9374ceefcfdac027fd /pkg/commands/git.go
parentaaa8558de83b109e59e752819e02925da4c134b5 (diff)
support filenames that match branchnames
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r--pkg/commands/git.go8
1 files changed, 2 insertions, 6 deletions
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)