1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

Fix problems with patches if git diff was customized with config.

This commit is contained in:
Matthias Richerzhagen
2024-01-15 13:48:41 +01:00
committed by Stefan Haller
parent a2ff2e6dd9
commit afbaf82395

View File

@ -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()
}