feature<DeleteSubmodule>: add context menu to delete submodules

This commit is contained in:
leo 2021-04-12 09:53:59 +08:00
parent eaabfcf28e
commit 3edb8bf2dd
6 changed files with 115 additions and 0 deletions

View file

@ -974,6 +974,27 @@ namespace SourceGit.Git {
isWatcherDisabled = false;
}
/// <summary>
/// Delete submodule
/// </summary>
/// <param name="path"></param>
public void DeleteSubmodule(string path) {
isWatcherDisabled = true;
var errs = RunCommand($"submodule deinit -f {path}", null);
if (errs != null) {
App.RaiseError(errs);
} else {
errs = RunCommand($"rm -f {path}", null);
if (errs != null) App.RaiseError(errs);
OnWorkingCopyChanged?.Invoke();
OnSubmoduleChanged?.Invoke();
}
isWatcherDisabled = false;
}
/// <summary>
/// Blame file.
/// </summary>