diff --git a/SourceGit/Git/Repository.cs b/SourceGit/Git/Repository.cs index e549dd8e..a96c93ae 100644 --- a/SourceGit/Git/Repository.cs +++ b/SourceGit/Git/Repository.cs @@ -907,6 +907,22 @@ namespace SourceGit.Git { isWatcherDisabled = false; } + /// + /// Update submodule. + /// + public void UpdateSubmodule() { + isWatcherDisabled = true; + + var errs = RunCommand("submodule update", null); + if (errs != null) { + App.RaiseError(errs); + } else { + OnSubmoduleChanged?.Invoke(); + } + + isWatcherDisabled = false; + } + /// /// Blame file. /// diff --git a/SourceGit/UI/Dashboard.xaml.cs b/SourceGit/UI/Dashboard.xaml.cs index df2c6e93..c260b654 100644 --- a/SourceGit/UI/Dashboard.xaml.cs +++ b/SourceGit/UI/Dashboard.xaml.cs @@ -927,10 +927,7 @@ namespace SourceGit.UI { } private void UpdateSubmodule(object sender, RoutedEventArgs e) { - Waiting.Show(() => { - var errs = repo.RunCommand("submodule update", PopupManager.UpdateStatus, true); - if (errs != null) App.RaiseError(errs); - }); + Waiting.Show(() => repo.UpdateSubmodule()); } private void SubmoduleLostFocus(object sender, RoutedEventArgs e) {