git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Karl Hasselström" <kha@treskal.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org, "Aneesh Kumar" <aneesh.kumar@gmail.com>,
	"Karl Hasselström" <kha@treskal.com>
Subject: [StGit PATCH 1/4] Don't special-case the "master" branch during branch delete
Date: Sat, 22 Sep 2007 10:46:19 +0200	[thread overview]
Message-ID: <20070922084619.29884.94401.stgit@yoghurt> (raw)
In-Reply-To: <20070922084334.29884.60506.stgit@yoghurt>

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@treskal.com>

---

 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()
 

  reply	other threads:[~2007-09-22  8:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-21  4:40 stg branch --delete doesn't work Aneesh Kumar
2007-09-21  9:48 ` Karl Hasselström
2007-09-22  8:46   ` [StGit PATCH 0/4] Fix "stg branch --delete" Karl Hasselström
2007-09-22  8:46     ` Karl Hasselström [this message]
2007-09-22  8:46     ` [StGit PATCH 2/4] Don't try to delete the branch twice Karl Hasselström
2007-09-22  8:46     ` [StGit PATCH 3/4] Properly remove all config for a deleted branch Karl Hasselström
2007-09-22  8:46     ` [StGit PATCH 4/4] Add simple test for "stg branch --delete" Karl Hasselström

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070922084619.29884.94401.stgit@yoghurt \
    --to=kha@treskal.com \
    --cc=aneesh.kumar@gmail.com \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).