mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
refactor: external diff merge tool - supports to use difftool/mergetool settings from git config directly (#181)
This commit is contained in:
parent
06245320a9
commit
c56d0cf85e
15 changed files with 89 additions and 163 deletions
|
@ -1120,20 +1120,11 @@ namespace SourceGit.ViewModels
|
|||
|
||||
private async void UseExternalMergeTool(Models.Change change)
|
||||
{
|
||||
var type = Preference.Instance.ExternalMergeToolType;
|
||||
var exec = Preference.Instance.ExternalMergeToolPath;
|
||||
|
||||
var tool = Models.ExternalMerger.Supported.Find(x => x.Type == type);
|
||||
if (tool == null)
|
||||
{
|
||||
App.RaiseException(_repo.FullPath, "Invalid merge tool in preference setting!");
|
||||
return;
|
||||
}
|
||||
|
||||
var args = tool.Type != 0 ? tool.Cmd : Preference.Instance.ExternalMergeToolCmd;
|
||||
var toolType = Preference.Instance.ExternalMergeToolType;
|
||||
var toolPath = Preference.Instance.ExternalMergeToolPath;
|
||||
|
||||
_repo.SetWatcherEnabled(false);
|
||||
await Task.Run(() => Commands.MergeTool.OpenForMerge(_repo.FullPath, exec, args, change.Path));
|
||||
await Task.Run(() => Commands.MergeTool.OpenForMerge(_repo.FullPath, toolType, toolPath, change.Path));
|
||||
_repo.SetWatcherEnabled(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue