summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorDavyd McColl <davydm@gmail.com>2021-06-14 10:45:29 +0200
committerJesse Duffield <jessedduffield@gmail.com>2021-07-01 17:13:14 +1000
commitae2496cf809533a16e7494470fdf5209fa023804 (patch)
tree730b91f1560590fb1520d06a87ded60264dcb017 /pkg/commands
parent2ac33bb83d661a53a10816e9ba4714e2aa747fe9 (diff)
:art: prefer the long switch over the short one for easier reading
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/files.go2
-rw-r--r--pkg/commands/files_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/pkg/commands/files.go b/pkg/commands/files.go
index 648c5f511..f4588aac5 100644
--- a/pkg/commands/files.go
+++ b/pkg/commands/files.go
@@ -211,7 +211,7 @@ func (c *GitCommand) WorktreeFileDiffCmdStr(node models.IFile, plain bool, cache
colorArg = "never"
}
if ignoreWhitespace {
- ignoreWhitespaceArg = "-w"
+ ignoreWhitespaceArg = "--ignore-all-space"
}
return fmt.Sprintf("git diff --submodule --no-ext-diff --color=%s %s %s %s %s", colorArg, ignoreWhitespaceArg, cachedArg, trackedArg, path)
diff --git a/pkg/commands/files_test.go b/pkg/commands/files_test.go
index 867b75e32..fd4b9f69f 100644
--- a/pkg/commands/files_test.go
+++ b/pkg/commands/files_test.go
@@ -414,7 +414,7 @@ func TestGitCommandDiff(t *testing.T) {
"Default case (ignore whitespace)",
func(cmd string, args ...string) *exec.Cmd {
assert.EqualValues(t, "git", cmd)
- assert.EqualValues(t, []string{"diff", "--submodule", "--no-ext-diff", "--color=always", "-w", "--", "test.txt"}, args)
+ assert.EqualValues(t, []string{"diff", "--submodule", "--no-ext-diff", "--color=always", "--ignore-all-space", "--", "test.txt"}, args)
return secureexec.Command("echo")
},