summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorGlenn Vriesman <glenn.vriesman@gmail.com>2020-02-03 20:05:01 +0100
committerJesse Duffield <jessedduffield@gmail.com>2020-02-04 08:41:41 +1100
commit5f53d50492ec9f09fcd5d7e239e59585441ce5cb (patch)
tree0cbd39126504762426750b7e10ade7a2d7acd932 /pkg
parent5f71f874968e3e73d98b57801a4deb1c587da79c (diff)
Check cached when showing new file diffs
Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/commands/git.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index d3f528c8e..adf304acd 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -592,7 +592,7 @@ func (c *GitCommand) DiffCmdStr(file *File, plain bool, cached bool) string {
if cached {
cachedArg = "--cached"
}
- if !file.Tracked && !file.HasStagedChanges {
+ if !file.Tracked && !file.HasStagedChanges && !cached {
trackedArg = "--no-index /dev/null"
}
if plain {