From 57059512207410968f8e796454b03ffdf118ef4e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karl=20Hasselstr=C3=B6m?= Date: Sat, 22 Sep 2007 09:54:25 +0200 Subject: [PATCH] Don't special-case the "master" branch during branch delete MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- stgit/commands/branch.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/stgit/commands/branch.py b/stgit/commands/branch.py index 2d491d50..8c999363 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() -- 2.11.4.GIT