summaryrefslogtreecommitdiffstats
path: root/subcmds/abandon.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/abandon.py')
-rw-r--r--subcmds/abandon.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/subcmds/abandon.py b/subcmds/abandon.py
index 319262bd..cd1d0c40 100644
--- a/subcmds/abandon.py
+++ b/subcmds/abandon.py
@@ -37,19 +37,19 @@ It is equivalent to "git branch -D <branchname>".
37 dest='all', action='store_true', 37 dest='all', action='store_true',
38 help='delete all branches in all projects') 38 help='delete all branches in all projects')
39 39
40 def Execute(self, opt, args): 40 def ValidateOptions(self, opt, args):
41 if not opt.all and not args: 41 if not opt.all and not args:
42 self.Usage() 42 self.Usage()
43 43
44 if not opt.all: 44 if not opt.all:
45 nb = args[0] 45 nb = args[0]
46 if not git.check_ref_format('heads/%s' % nb): 46 if not git.check_ref_format('heads/%s' % nb):
47 print("error: '%s' is not a valid name" % nb, file=sys.stderr) 47 self.OptionParser.error("'%s' is not a valid branch name" % nb)
48 sys.exit(1)
49 else: 48 else:
50 args.insert(0,None) 49 args.insert(0, "'All local branches'")
51 nb = "'All local branches'"
52 50
51 def Execute(self, opt, args):
52 nb = args[0]
53 err = defaultdict(list) 53 err = defaultdict(list)
54 success = defaultdict(list) 54 success = defaultdict(list)
55 all_projects = self.GetProjects(args[1:]) 55 all_projects = self.GetProjects(args[1:])