From afbaf82395a76514333557453458a22ec736ad6e Mon Sep 17 00:00:00 2001 From: Matthias Richerzhagen Date: Mon, 15 Jan 2024 13:48:41 +0100 Subject: Fix problems with patches if `git diff` was customized with config. --- pkg/commands/git_commands/patch.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg/commands') diff --git a/pkg/commands/git_commands/patch.go b/pkg/commands/git_commands/patch.go index 749e5dc22..c632e35ae 100644 --- a/pkg/commands/git_commands/patch.go +++ b/pkg/commands/git_commands/patch.go @@ -321,7 +321,11 @@ func (self *PatchCommands) PullPatchIntoNewCommit( // only some lines of a range of adjacent added lines. To solve this, we // get the diff of HEAD and the original commit and then apply that. func (self *PatchCommands) diffHeadAgainstCommit(commit *models.Commit) (string, error) { - cmdArgs := NewGitCmd("diff").Arg("HEAD.." + commit.Sha).ToArgv() + cmdArgs := NewGitCmd("diff"). + Config("diff.noprefix=false"). + Arg("--no-ext-diff"). + Arg("HEAD.." + commit.Sha). + ToArgv() return self.cmd.New(cmdArgs).RunWithOutput() } -- cgit v1.2.3