From 42a3762d0138d6dd0c0f96964be98d0b21ab6bef Mon Sep 17 00:00:00 2001 From: "Joshua M. Clulow" Date: Mon, 22 Oct 2018 12:18:58 -0700 Subject: 9913 git pbchk should still accept -b Reviewed by: Toomas Soome Reviewed by: Andy Fiddaman Approved by: Garrett D'Amore --- usr/src/tools/scripts/git-pbchk.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'usr/src/tools/scripts/git-pbchk.py') diff --git a/usr/src/tools/scripts/git-pbchk.py b/usr/src/tools/scripts/git-pbchk.py index 0d3fc89f1e..7f3956ac42 100644 --- a/usr/src/tools/scripts/git-pbchk.py +++ b/usr/src/tools/scripts/git-pbchk.py @@ -375,27 +375,25 @@ def main(cmd, args): checkname = None try: - opts, args = getopt.getopt(args, 'c:p:') + opts, args = getopt.getopt(args, 'b:c:p:') except getopt.GetoptError, e: sys.stderr.write(str(e) + '\n') sys.stderr.write("Usage: %s [-c check] [-p branch] [path...]\n" % cmd) sys.exit(1) for opt, arg in opts: - # backwards compatibility - if opt == '-b': + # We accept "-b" as an alias of "-p" for backwards compatibility. + if opt == '-p' or opt == '-b': parent_branch = arg elif opt == '-c': checkname = arg - elif opt == '-p': - parent_branch = arg if not parent_branch: parent_branch = git_parent_branch(git_branch()) if checkname is None: if cmd == 'git-pbchk': - checkname= 'pbchk' + checkname = 'pbchk' else: checkname = 'nits' -- cgit v1.2.3