Skip to content

Commit 8a472cb

Browse files
committed
fix: sometimes tags did not update after deleting selected tag (#908)
1 parent 53ec53a commit 8a472cb

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

src/Models/Watcher.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ public void MarkBranchDirtyManually()
7272
_updateBranch = DateTime.Now.ToFileTime() - 1;
7373
}
7474

75+
public void MarkTagDirtyManually()
76+
{
77+
_updateTags = DateTime.Now.ToFileTime() - 1;
78+
}
79+
7580
public void MarkWorkingCopyDirtyManually()
7681
{
7782
_updateWC = DateTime.Now.ToFileTime() - 1;

src/ViewModels/DeleteTag.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ public override Task<bool> Sure()
3333
{
3434
var remotes = ShouldPushToRemote ? _repo.Remotes : null;
3535
var succ = Commands.Tag.Delete(_repo.FullPath, Target.Name, remotes);
36-
CallUIThread(() => _repo.SetWatcherEnabled(true));
36+
CallUIThread(() =>
37+
{
38+
_repo.MarkTagsDirtyManually();
39+
_repo.SetWatcherEnabled(true);
40+
});
3741
return succ;
3842
});
3943
}

src/ViewModels/Repository.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,19 @@ public void MarkBranchesDirtyManually()
771771
}
772772
}
773773

774+
public void MarkTagsDirtyManually()
775+
{
776+
if (_watcher == null)
777+
{
778+
Task.Run(RefreshTags);
779+
Task.Run(RefreshCommits);
780+
}
781+
else
782+
{
783+
_watcher.MarkTagDirtyManually();
784+
}
785+
}
786+
774787
public void MarkWorkingCopyDirtyManually()
775788
{
776789
if (_watcher == null)

0 commit comments

Comments
 (0)