fix<ExternalMergeTool>: ignore type change on serialization

This commit is contained in:
leo 2024-02-19 16:25:50 +08:00
parent e7219b4278
commit df16622335

View file

@ -125,7 +125,7 @@ namespace SourceGit.ViewModels {
get => _externalMergeToolType; get => _externalMergeToolType;
set { set {
var changed = SetProperty(ref _externalMergeToolType, value); var changed = SetProperty(ref _externalMergeToolType, value);
if (changed && !OperatingSystem.IsWindows() && value >= 0 && value < Models.ExternalMergeTools.Supported.Count) { if (changed && !OperatingSystem.IsWindows() && value > 0 && value < Models.ExternalMergeTools.Supported.Count) {
var tool = Models.ExternalMergeTools.Supported[value]; var tool = Models.ExternalMergeTools.Supported[value];
if (File.Exists(tool.Exec)) ExternalMergeToolPath = tool.Exec; if (File.Exists(tool.Exec)) ExternalMergeToolPath = tool.Exec;
else ExternalMergeToolPath = string.Empty; else ExternalMergeToolPath = string.Empty;