chiark / gitweb /
Make switching to the current branch a no-op
[stgit] / stgit / commands / branch.py
index c731a6987951b23bf8cfd5e3984784668e16c3ea..3e5efef132d98d54baa5703a41d1b67c3c8fc08d 100644 (file)
@@ -197,6 +197,9 @@ def func(parser, options, args):
 
     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()