diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-02-18 15:34:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-18 15:34:09 +0100 |
commit | 43020184373abb624971bb81aebd34ea214addee (patch) | |
tree | ff71e43fdf84b59c3efc83b291a955ae5a88f76d /pkg/commands/git_commands/working_tree.go | |
parent | a2ff2e6dd92c7b1bcfa41798548d3cd4f439dfa8 (diff) | |
parent | 236f42879ce9174600c9944f136e0fe266287413 (diff) |
Fix some problems with patches if `git diff` was customized with config (e.g. `external` or `noprefix`). (#3222)
- **PR Description**
I encountered the problem that I couldn't extract changes into a new
commit because I had difftastic as an external git tool configured.
Add `diff.noprefix=false` config Option and also specify `--no-ext-diff`
when doing the `git diff` after applying a patch.
This fixes #3107.
Though, there might be other config options that can cause problems, but
fixing these common cases should be an improvement nevertheless.
Diffstat (limited to 'pkg/commands/git_commands/working_tree.go')
-rw-r--r-- | pkg/commands/git_commands/working_tree.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/commands/git_commands/working_tree.go b/pkg/commands/git_commands/working_tree.go index 054a272d4..2bb82578d 100644 --- a/pkg/commands/git_commands/working_tree.go +++ b/pkg/commands/git_commands/working_tree.go @@ -291,6 +291,7 @@ func (self *WorkingTreeCommands) ShowFileDiffCmdObj(from string, to string, reve useExtDiff := extDiffCmd != "" && !plain cmdArgs := NewGitCmd("diff"). + Config("diff.noprefix=false"). ConfigIf(useExtDiff, "diff.external="+extDiffCmd). ArgIfElse(useExtDiff, "--ext-diff", "--no-ext-diff"). Arg("--submodule"). |