diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-17 22:25:53 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-17 22:25:53 +1000 |
commit | 03a7e32694216ae4e7b3150a0f6305a960a7980d (patch) | |
tree | 235b3fd488f5e779c21e3d9374ceefcfdac027fd /pkg/commands/git.go | |
parent | aaa8558de83b109e59e752819e02925da4c134b5 (diff) |
support filenames that match branchnames
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r-- | pkg/commands/git.go | 8 |
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) |