mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-30 08:34:59 +00:00
feature<DeleteSubmodule>: add context menu to delete submodules
This commit is contained in:
parent
eaabfcf28e
commit
3edb8bf2dd
6 changed files with 115 additions and 0 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue