chiark
/
gitweb
/
~mdw
/
stgit
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
547eb28
)
Make switching to the current branch a no-op
author
Chuck Lever
<cel@netapp.com>
Wed, 26 Oct 2005 18:51:45 +0000
(14:51 -0400)
committer
Catalin Marinas
<catalin.marinas@gmail.com>
Thu, 27 Oct 2005 19:47:12 +0000
(20:47 +0100)
Check if "stg branch name" is switching to the branch we are already in,
and make that case a no-op.
Signed-off-by: Chuck Lever <cel@netapp.com>
stgit/commands/branch.py
patch
|
blob
|
blame
|
history
diff --git
a/stgit/commands/branch.py
b/stgit/commands/branch.py
index c731a6987951b23bf8cfd5e3984784668e16c3ea..3e5efef132d98d54baa5703a41d1b67c3c8fc08d 100644
(file)
--- a/
stgit/commands/branch.py
+++ b/
stgit/commands/branch.py
@@
-197,6
+197,9
@@
def func(parser, options, args):
elif len(args) == 1:
elif len(args) == 1:
+ if args[0] == git.get_head_file():
+ raise CmdException, 'Branch "%s" is already the current branch' % args[0]
+
print 'Switching to branch "%s"...' % args[0],
sys.stdout.flush()
print 'Switching to branch "%s"...' % args[0],
sys.stdout.flush()