summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2021-05-03 01:10:09 -0400
committerMike Frysinger <vapier@google.com>2021-05-04 11:31:48 +0000
commit7356114d908471a54b5a7e725f36d9111c6fab5b (patch)
tree42a63fd5676b435abfce1471239e9b5ebbd84710 /project.py
parentb8e09ea1d6e8051697da52db1291e8267844e206 (diff)
downloadgit-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 'project.py')
-rw-r--r--project.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/project.py b/project.py
index f05ce66a..ab28f2c3 100644
--- a/project.py
+++ b/project.py
@@ -1041,7 +1041,7 @@ class Project(object):
1041 verbose=False, 1041 verbose=False,
1042 output_redir=None, 1042 output_redir=None,
1043 is_new=None, 1043 is_new=None,
1044 current_branch_only=False, 1044 current_branch_only=None,
1045 force_sync=False, 1045 force_sync=False,
1046 clone_bundle=True, 1046 clone_bundle=True,
1047 tags=True, 1047 tags=True,
@@ -1116,7 +1116,7 @@ class Project(object):
1116 and self._ApplyCloneBundle(initial=is_new, quiet=quiet, verbose=verbose)): 1116 and self._ApplyCloneBundle(initial=is_new, quiet=quiet, verbose=verbose)):
1117 is_new = False 1117 is_new = False
1118 1118
1119 if not current_branch_only: 1119 if current_branch_only is None:
1120 if self.sync_c: 1120 if self.sync_c:
1121 current_branch_only = True 1121 current_branch_only = True
1122 elif not self.manifest._loaded: 1122 elif not self.manifest._loaded: