Add button for running external mergetool on ALL conflicts (#1173)

* Make a few non-translated strings localizable (in Conflict view)

* Add button and wiring to run mergetool on all conflicts

* Corrected spelling and wording in related code and exception msg
This commit is contained in:
Göran W 2025-04-11 03:33:07 +02:00 committed by GitHub
parent 3b18ee0b37
commit 47824dc27a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 48 additions and 25 deletions

View file

@ -13,9 +13,12 @@ namespace SourceGit.Commands
cmd.Context = repo;
cmd.RaiseError = true;
// NOTE: If no <file> names are specified, 'git mergetool' will run the merge tool program on every file with merge conflicts.
var file_arg = string.IsNullOrEmpty(file) ? "" : $"\"{file}\"";
if (toolType == 0)
{
cmd.Args = $"mergetool \"{file}\"";
cmd.Args = $"mergetool {file_arg}";
return cmd.Exec();
}
@ -32,7 +35,7 @@ namespace SourceGit.Commands
return false;
}
cmd.Args = $"-c mergetool.sourcegit.cmd=\"\\\"{toolPath}\\\" {supported.Cmd}\" -c mergetool.writeToTemp=true -c mergetool.keepBackup=false -c mergetool.trustExitCode=true mergetool --tool=sourcegit \"{file}\"";
cmd.Args = $"-c mergetool.sourcegit.cmd=\"\\\"{toolPath}\\\" {supported.Cmd}\" -c mergetool.writeToTemp=true -c mergetool.keepBackup=false -c mergetool.trustExitCode=true mergetool --tool=sourcegit {file_arg}";
return cmd.Exec();
}