It's unintuitive, unsymmetric and doesn't work if there is no "master". Instead, prohibit deletion of the current branch. Signed-off-by: Karl Hasselström <kha@xxxxxxxxxxx> --- stgit/commands/branch.py | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) diff --git a/stgit/commands/branch.py b/stgit/commands/branch.py index 2d491d5..8c99936 100644 --- a/stgit/commands/branch.py +++ b/stgit/commands/branch.py @@ -96,17 +96,10 @@ def __delete_branch(doomed_name, force = False): out.start('Deleting branch "%s"' % doomed_name) if __is_current_branch(doomed_name): - check_local_changes() - check_conflicts() - check_head_top_equal() - - if doomed_name != 'master': - git.switch_branch('master') + raise CmdException('Cannot delete the current branch') doomed.delete(force) - - if doomed_name != 'master': - git.delete_branch(doomed_name) + git.delete_branch(doomed_name) out.done() - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html