fix: sometimes tags did not update after deleting selected tag (#908)
Some checks failed
Continuous Integration / Build (push) Has been cancelled
Continuous Integration / Prepare version string (push) Has been cancelled
Localization Check / localization-check (push) Has been cancelled
Continuous Integration / Package (push) Has been cancelled

This commit is contained in:
leo 2025-01-15 10:42:35 +08:00
parent 53ec53a6ee
commit 8a472cb472
No known key found for this signature in database
3 changed files with 23 additions and 1 deletions

View file

@ -72,6 +72,11 @@ namespace SourceGit.Models
_updateBranch = DateTime.Now.ToFileTime() - 1; _updateBranch = DateTime.Now.ToFileTime() - 1;
} }
public void MarkTagDirtyManually()
{
_updateTags = DateTime.Now.ToFileTime() - 1;
}
public void MarkWorkingCopyDirtyManually() public void MarkWorkingCopyDirtyManually()
{ {
_updateWC = DateTime.Now.ToFileTime() - 1; _updateWC = DateTime.Now.ToFileTime() - 1;

View file

@ -33,7 +33,11 @@ namespace SourceGit.ViewModels
{ {
var remotes = ShouldPushToRemote ? _repo.Remotes : null; var remotes = ShouldPushToRemote ? _repo.Remotes : null;
var succ = Commands.Tag.Delete(_repo.FullPath, Target.Name, remotes); var succ = Commands.Tag.Delete(_repo.FullPath, Target.Name, remotes);
CallUIThread(() => _repo.SetWatcherEnabled(true)); CallUIThread(() =>
{
_repo.MarkTagsDirtyManually();
_repo.SetWatcherEnabled(true);
});
return succ; return succ;
}); });
} }

View file

@ -771,6 +771,19 @@ namespace SourceGit.ViewModels
} }
} }
public void MarkTagsDirtyManually()
{
if (_watcher == null)
{
Task.Run(RefreshTags);
Task.Run(RefreshCommits);
}
else
{
_watcher.MarkTagDirtyManually();
}
}
public void MarkWorkingCopyDirtyManually() public void MarkWorkingCopyDirtyManually()
{ {
if (_watcher == null) if (_watcher == null)