fix(Checkout): never update repository when checkout failed.

This commit is contained in:
leo 2020-08-11 19:47:13 +08:00
parent 8bc23a7d71
commit fa1a86b7ac
2 changed files with 14 additions and 4 deletions

View file

@ -588,7 +588,17 @@ namespace SourceGit.Git {
isWatcherDisabled = true;
var errs = RunCommand($"checkout {option}", null);
AssertCommand(errs);
if (errs != null) {
App.RaiseError(errs);
} else {
Branches(true);
OnBranchChanged?.Invoke();
OnCommitsChanged?.Invoke();
OnWorkingCopyChanged?.Invoke();
OnTagChanged?.Invoke();
}
isWatcherDisabled = false;
}
/// <summary>