diff options
author | Mike Frysinger <vapier@google.com> | 2021-05-03 01:10:09 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2021-05-04 11:31:48 +0000 |
commit | 7356114d908471a54b5a7e725f36d9111c6fab5b (patch) | |
tree | 42a63fd5676b435abfce1471239e9b5ebbd84710 /subcmds/info.py | |
parent | b8e09ea1d6e8051697da52db1291e8267844e206 (diff) | |
download | git-repo-7356114d908471a54b5a7e725f36d9111c6fab5b.tar.gz |
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 <rtenneti@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'subcmds/info.py')
-rw-r--r-- | subcmds/info.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/subcmds/info.py b/subcmds/info.py index 8e017ed8..2be56109 100644 --- a/subcmds/info.py +++ b/subcmds/info.py | |||
@@ -39,6 +39,9 @@ class Info(PagedCommand): | |||
39 | p.add_option('-c', '--current-branch', | 39 | p.add_option('-c', '--current-branch', |
40 | dest="current_branch", action="store_true", | 40 | dest="current_branch", action="store_true", |
41 | help="consider only checked out branches") | 41 | help="consider only checked out branches") |
42 | p.add_option('--no-current-branch', | ||
43 | dest='current_branch', action='store_false', | ||
44 | help='consider all local branches') | ||
42 | # Turn this into a warning & remove this someday. | 45 | # Turn this into a warning & remove this someday. |
43 | p.add_option('-b', | 46 | p.add_option('-b', |
44 | dest='current_branch', action='store_true', | 47 | dest='current_branch', action='store_true', |