From 03a7e32694216ae4e7b3150a0f6305a960a7980d Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Fri, 17 Aug 2018 22:25:53 +1000 Subject: [PATCH] support filenames that match branchnames --- pkg/commands/git.go | 8 ++------ 1 file 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)