diff options
author | Matthias Richerzhagen <mricherzhagen@users.noreply.github.com> | 2024-01-15 13:48:41 +0100 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-02-18 15:22:43 +0100 |
commit | afbaf82395a76514333557453458a22ec736ad6e (patch) | |
tree | 1f637be55c1005f62aa249eb95ad51a36e518e6e | |
parent | a2ff2e6dd92c7b1bcfa41798548d3cd4f439dfa8 (diff) |
Fix problems with patches if `git diff` was customized with config.
-rw-r--r-- | pkg/commands/git_commands/patch.go | 6 |
1 files changed, 5 insertions, 1 deletions
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() } |