feature(Submodule): add button to do submodule update

This commit is contained in:
leo 2020-07-24 17:17:53 +08:00
parent 1896ae1daf
commit 0e9b1574a8
5 changed files with 62 additions and 7 deletions

View file

@ -223,7 +223,7 @@ namespace SourceGit.UI {
foreach (var b in branches) {
if (b.IsLocal) {
MakeBranchNode(b, localBranchNodes, folders, states, "locals");
} else {
} else if (!string.IsNullOrEmpty(b.Remote)) {
RemoteNode remote = null;
if (!remoteMap.ContainsKey(b.Remote)) {
@ -926,6 +926,13 @@ namespace SourceGit.UI {
AddSubmodule.Show(repo);
}
private void UpdateSubmodule(object sender, RoutedEventArgs e) {
Waiting.Show(() => {
var errs = repo.RunCommand("submodule update", PopupManager.UpdateStatus, true);
if (errs != null) App.RaiseError(errs);
});
}
private void SubmoduleLostFocus(object sender, RoutedEventArgs e) {
(sender as DataGrid).UnselectAll();
}