diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-08-03 11:04:48 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2023-09-04 13:16:00 +0200 |
commit | c67aa49856cf7ffaac7665237a3c3b0af40358fd (patch) | |
tree | 832d5453bd69176a60399cdb115dfa27fb1387ab | |
parent | 3a5408985986a2b9697e0f7572228c64a0b36cf8 (diff) |
Add explicit --no-ext-diff arg to CommitCommands.ShowCmdObj
We do this for ShowFileDiffCmdObj and WorktreeFileDiffCmdObj too, so why not
here.
-rw-r--r-- | pkg/commands/git_commands/commit.go | 1 | ||||
-rw-r--r-- | pkg/commands/git_commands/commit_test.go | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/pkg/commands/git_commands/commit.go b/pkg/commands/git_commands/commit.go index ec27d66cb..94198ee3f 100644 --- a/pkg/commands/git_commands/commit.go +++ b/pkg/commands/git_commands/commit.go @@ -201,6 +201,7 @@ func (self *CommitCommands) ShowCmdObj(sha string, filterPath string, ignoreWhit cmdArgs := NewGitCmd("show"). Arg("--submodule"). + Arg("--no-ext-diff"). Arg("--color="+self.UserConfig.Git.Paging.ColorArg). Arg(fmt.Sprintf("--unified=%d", contextSize)). Arg("--stat"). diff --git a/pkg/commands/git_commands/commit_test.go b/pkg/commands/git_commands/commit_test.go index d25d613b2..5bec1c67e 100644 --- a/pkg/commands/git_commands/commit_test.go +++ b/pkg/commands/git_commands/commit_test.go @@ -195,28 +195,28 @@ func TestCommitShowCmdObj(t *testing.T) { filterPath: "", contextSize: 3, ignoreWhitespace: false, - expected: []string{"show", "--submodule", "--color=always", "--unified=3", "--stat", "--decorate", "-p", "1234567890"}, + expected: []string{"show", "--submodule", "--no-ext-diff", "--color=always", "--unified=3", "--stat", "--decorate", "-p", "1234567890"}, }, { testName: "Default case with filter path", filterPath: "file.txt", contextSize: 3, ignoreWhitespace: false, - expected: []string{"show", "--submodule", "--color=always", "--unified=3", "--stat", "--decorate", "-p", "1234567890", "--", "file.txt"}, + expected: []string{"show", "--submodule", "--no-ext-diff", "--color=always", "--unified=3", "--stat", "--decorate", "-p", "1234567890", "--", "file.txt"}, }, { testName: "Show diff with custom context size", filterPath: "", contextSize: 77, ignoreWhitespace: false, - expected: []string{"show", "--submodule", "--color=always", "--unified=77", "--stat", "--decorate", "-p", "1234567890"}, + expected: []string{"show", "--submodule", "--no-ext-diff", "--color=always", "--unified=77", "--stat", "--decorate", "-p", "1234567890"}, }, { testName: "Show diff, ignoring whitespace", filterPath: "", contextSize: 77, ignoreWhitespace: true, - expected: []string{"show", "--submodule", "--color=always", "--unified=77", "--stat", "--decorate", "-p", "1234567890", "--ignore-all-space"}, + expected: []string{"show", "--submodule", "--no-ext-diff", "--color=always", "--unified=77", "--stat", "--decorate", "-p", "1234567890", "--ignore-all-space"}, }, } |