diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 662d58fa..b5a72763 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -113,11 +113,19 @@ namespace SourceGit.ViewModels public void NavigateTo(string commitSHA) { var commit = _commits.Find(x => x.SHA.StartsWith(commitSHA, StringComparison.Ordinal)); - if (commit != null) + if (commit == null) + { + AutoSelectedCommit = null; + commit = new Commands.QuerySingleCommit(_repo.FullPath, commitSHA).Result(); + } + else { AutoSelectedCommit = commit; NavigationId = _navigationId + 1; + } + if (commit != null) + { if (_detailContext is CommitDetail detail) { detail.Commit = commit; @@ -129,6 +137,10 @@ namespace SourceGit.ViewModels DetailContext = commitDetail; } } + else + { + DetailContext = null; + } } public void Select(IList commits)