enhance: wait a while after branch changed (#1254)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-04-28 16:19:40 +08:00
parent 2698427cd0
commit 30d42b11e2
No known key found for this signature in database
3 changed files with 16 additions and 0 deletions

View file

@ -62,6 +62,8 @@ namespace SourceGit.ViewModels
CallUIThread(() =>
{
ProgressDescription = "Waiting for branch updated...";
var b = _repo.Branches.Find(x => x.IsLocal && x.Name == Branch);
if (b != null && _repo.HistoriesFilterMode == Models.FilterMode.Included)
_repo.SetBranchFilterMode(b, Models.FilterMode.Included, true, false);
@ -70,6 +72,7 @@ namespace SourceGit.ViewModels
_repo.SetWatcherEnabled(true);
});
Task.Delay(400).Wait();
return rs;
});
}

View file

@ -150,6 +150,12 @@ namespace SourceGit.ViewModels
_repo.SetWatcherEnabled(true);
});
if (CheckoutAfterCreated)
{
CallUIThread(() => ProgressDescription = "Waiting for branch updated...");
Task.Delay(400).Wait();
}
return true;
});
}

View file

@ -58,12 +58,15 @@ namespace SourceGit.ViewModels
return Task.Run(() =>
{
var isCurrent = Target.IsCurrent;
var oldName = Target.FullName;
var succ = Commands.Branch.Rename(_repo.FullPath, Target.Name, fixedName, log);
log.Complete();
CallUIThread(() =>
{
ProgressDescription = "Waiting for branch updated...";
if (succ)
{
foreach (var filter in _repo.Settings.HistoriesFilters)
@ -80,6 +83,10 @@ namespace SourceGit.ViewModels
_repo.MarkBranchesDirtyManually();
_repo.SetWatcherEnabled(true);
});
if (isCurrent)
Task.Delay(400).Wait();
return succ;
});
}