From 7356114d908471a54b5a7e725f36d9111c6fab5b Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 3 May 2021 01:10:09 -0400 Subject: add --no-current-branch option to invert --current-branch For most commands, this is more about providing a way to undo earlier command line options (e.g. `repo info -c --no-current-branch`) which can be helpful for scripting & automation. But for the sync command, this is helpful to undo the setting that exists in the manifest itself. With this in place, tweak the sync current_branch_only logic to only apply the manifest settings when the user hasn't specified a command line option. Bug: https://crbug.com/gerrit/12401 Change-Id: I21e2384624680cc740d1b5d1e49c50589d2fe6a0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/304903 Reviewed-by: Raman Tenneti Tested-by: Mike Frysinger --- subcmds/upload.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'subcmds/upload.py') diff --git a/subcmds/upload.py b/subcmds/upload.py index 57434b18..c497d877 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py @@ -174,6 +174,9 @@ Gerrit Code Review: https://www.gerritcodereview.com/ p.add_option('-c', '--current-branch', dest='current_branch', action='store_true', help='Upload current git branch.') + p.add_option('--no-current-branch', + dest='current_branch', action='store_false', + help='Upload all git branches.') # Turn this into a warning & remove this someday. p.add_option('--cbr', dest='current_branch', action='store_true', -- cgit v1.2.3-54-g00ecf