From ae2496cf809533a16e7494470fdf5209fa023804 Mon Sep 17 00:00:00 2001 From: Davyd McColl Date: Mon, 14 Jun 2021 10:45:29 +0200 Subject: [PATCH] :art: prefer the long switch over the short one for easier reading --- pkg/commands/files.go | 2 +- pkg/commands/files_test.go | 2 +- 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") },