Skip to content

Commit

Permalink
Insert artificial commits if filter without any matches is applied
Browse files Browse the repository at this point in the history
Handle selection after refresh if artificial commits are
removed from the view
  • Loading branch information
gerhardol committed Aug 22, 2022
1 parent 915cb47 commit 25b7a17
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions GitUI/UserControls/RevisionGrid/RevisionGridControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ void OnRevisionReadCompleted()
{
await TaskScheduler.Default;
// No revisions at all received
// No revisions at all received without any filter
await semaphoreUpdateGrid.WaitAsync(cancellationToken);
bool showArtificial = AddArtificialRevisions();
Expand Down Expand Up @@ -1291,7 +1291,7 @@ void OnRevisionReadCompleted()
IEnumerable<ObjectId> headParents = null;
bool refresh = false;
if (firstRevisionReceived && !headIsHandled && ShowArtificialRevisions())
if (!headIsHandled && ShowArtificialRevisions())
{
if (CurrentCheckout is not null)
{
Expand Down Expand Up @@ -1324,7 +1324,17 @@ void OnRevisionReadCompleted()
}
else
{
parents = TryGetParents(Module, _filterInfo, notSelectedId);
if (notSelectedId.IsArtificial)
{
notSelectedId = CurrentCheckout is not null
? CurrentCheckout
: _gridView.ToBeSelectedObjectIds.Where(id => !id.IsArtificial).FirstOrDefault();
}
if (notSelectedId is not null)
{
parents = TryGetParents(Module, _filterInfo, notSelectedId);
}
}
// Try to select the first of the parents
Expand Down

0 comments on commit 25b7a17

Please sign in to comment.