mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
enhance: wait a while after branch changed (#1254)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
2698427cd0
commit
30d42b11e2
3 changed files with 16 additions and 0 deletions
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue