feature<GitFlow>: add an option to keep branch after finish

This commit is contained in:
Rwing 2021-05-13 15:31:10 +08:00
parent 524eb8ef6d
commit 0f38b157e2
5 changed files with 23 additions and 5 deletions

View file

@ -50,16 +50,17 @@ namespace SourceGit.Commands {
Exec();
}
public void Finish(Models.GitFlowBranchType type, string name) {
public void Finish(Models.GitFlowBranchType type, string name, bool keepBranch) {
var option = keepBranch ? "-k" : string.Empty;
switch (type) {
case Models.GitFlowBranchType.Feature:
Args = $"flow feature finish {name}";
Args = $"flow feature finish {option} {name}";
break;
case Models.GitFlowBranchType.Release:
Args = $"flow release finish {name}";
Args = $"flow release finish {option} {name}";
break;
case Models.GitFlowBranchType.Hotfix:
Args = $"flow hotfix finish {name}";
Args = $"flow hotfix finish {option} {name}";
break;
default:
return;