summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands/diff.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/commands/git_commands/diff.go')
-rw-r--r--pkg/commands/git_commands/diff.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/commands/git_commands/diff.go b/pkg/commands/git_commands/diff.go
index 4720d5404..979279914 100644
--- a/pkg/commands/git_commands/diff.go
+++ b/pkg/commands/git_commands/diff.go
@@ -17,11 +17,15 @@ func NewDiffCommands(gitCommon *GitCommon) *DiffCommands {
}
func (self *DiffCommands) DiffCmdObj(diffArgs []string) oscommands.ICmdObj {
+ extDiffCmd := self.UserConfig.Git.Paging.ExternalDiffCommand
+ useExtDiff := extDiffCmd != ""
+
return self.cmd.New(
NewGitCmd("diff").
Config("diff.noprefix=false").
+ ConfigIf(useExtDiff, "diff.external="+extDiffCmd).
+ ArgIfElse(useExtDiff, "--ext-diff", "--no-ext-diff").
Arg("--submodule").
- Arg("--no-ext-diff").
Arg(fmt.Sprintf("--color=%s", self.UserConfig.Git.Paging.ColorArg)).
Arg(diffArgs...).
Dir(self.repoPaths.worktreePath).