feature: add a button to see which branches and tags that contains selected commit (#388)

This commit is contained in:
leo 2024-08-23 16:52:55 +08:00
parent fcc8a41ad1
commit 6ab0900b20
No known key found for this signature in database
14 changed files with 171 additions and 18 deletions

View file

@ -141,6 +141,11 @@ namespace SourceGit.ViewModels
_repo?.NavigateToCommit(commitSHA);
}
public List<Models.Decorator> GetRefsContainsThisCommit()
{
return new Commands.QueryRefsContainsCommit(_repo.FullPath, _commit.SHA).Result();
}
public void ClearSearchChangeFilter()
{
SearchChangeFilter = string.Empty;
@ -460,14 +465,18 @@ namespace SourceGit.ViewModels
if (_commit == null)
return;
Task.Run(() =>
{
var fullMessage = new Commands.QueryCommitFullMessage(_repo.FullPath, _commit.SHA).Result();
Dispatcher.UIThread.Invoke(() => FullMessage = fullMessage);
});
if (_cancelToken != null)
_cancelToken.Requested = true;
_cancelToken = new Commands.Command.CancelToken();
Task.Run(() =>
{
var fullMessage = new Commands.QueryCommitFullMessage(_repo.FullPath, _commit.SHA).Result();
var parent = _commit.Parents.Count == 0 ? "4b825dc642cb6eb9a060e54bf8d69288fbee4904" : _commit.Parents[0];
var cmdChanges = new Commands.CompareRevisions(_repo.FullPath, parent, _commit.SHA) { Cancel = _cancelToken };
var changes = cmdChanges.Result();
@ -486,7 +495,6 @@ namespace SourceGit.ViewModels
{
Dispatcher.UIThread.Post(() =>
{
FullMessage = fullMessage;
Changes = changes;
VisibleChanges = visible;
});