mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-30 13:51:53 +08:00
enhance: auto-select the first conflict file when no files are selected (#2053)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -264,8 +264,8 @@ namespace SourceGit.ViewModels
|
||||
return;
|
||||
|
||||
HasUnsolvedConflicts = _cached.Find(x => x.IsConflicted) != null;
|
||||
UpdateDetail();
|
||||
UpdateInProgressState();
|
||||
UpdateDetail();
|
||||
});
|
||||
|
||||
return;
|
||||
@@ -313,6 +313,12 @@ namespace SourceGit.ViewModels
|
||||
selectedStaged.Add(c);
|
||||
}
|
||||
|
||||
if (selectedUnstaged.Count == 0 && selectedStaged.Count == 0 && hasConflict)
|
||||
{
|
||||
var firstConflict = visibleUnstaged.Find(x => x.IsConflicted);
|
||||
selectedUnstaged.Add(firstConflict);
|
||||
}
|
||||
|
||||
Dispatcher.UIThread.Invoke(() =>
|
||||
{
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
@@ -329,8 +335,8 @@ namespace SourceGit.ViewModels
|
||||
SelectedStaged = selectedStaged;
|
||||
_isLoadingData = false;
|
||||
|
||||
UpdateDetail();
|
||||
UpdateInProgressState();
|
||||
UpdateDetail();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -336,7 +336,7 @@ namespace SourceGit.Views
|
||||
menu.Items.Add(useTheirs);
|
||||
menu.Items.Add(useMine);
|
||||
|
||||
if (change.ConflictReason is Models.ConflictReason.BothAdded or Models.ConflictReason.BothModified)
|
||||
if (change.ConflictReason is Models.ConflictReason.BothAdded or Models.ConflictReason.BothModified && !Directory.Exists(path))
|
||||
{
|
||||
var mergeBuiltin = new MenuItem();
|
||||
mergeBuiltin.Header = App.Text("ChangeCM.Merge");
|
||||
|
||||
Reference in New Issue
Block a user