mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-21 13:20:30 +08:00
enhance: wait a while after branch changed (#1254)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -150,6 +150,12 @@ namespace SourceGit.ViewModels
|
||||
_repo.SetWatcherEnabled(true);
|
||||
});
|
||||
|
||||
if (CheckoutAfterCreated)
|
||||
{
|
||||
CallUIThread(() => ProgressDescription = "Waiting for branch updated...");
|
||||
Task.Delay(400).Wait();
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user