summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorChirayu Desai <chirayudesai1@gmail.com>2020-02-04 17:50:57 +0530
committerMike Frysinger <vapier@google.com>2020-02-05 15:51:18 +0000
commitf7b64e3350a622ee87e1927cdbc8d854a5696d85 (patch)
tree1f803c802d71e3e4e669f5dbc796c78f01cdefb3 /project.py
parentbd0aae95f56d46cef665e11f2ee88581b88fcfce (diff)
downloadgit-repo-f7b64e3350a622ee87e1927cdbc8d854a5696d85.tar.gz
Do not try to fetch default revision for mirrors always
* Mirrors may contain multiple projects, some of which may not always contain the default revision. * Only fetch the default revision explicitly if '--current-branch' is set. * Fixes breakage casued by commit 6856f98467aa5c98085cdee02587dbab984cebb1 "Fix repo mirror with --current-branch" Bug: https://crbug.com/gerrit/12274 Change-Id: Iaafabe2992f76f3644b841f24245d3e19c9515a9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253093 Reviewed-by: Kuang-che Wu <kcwu@chromium.org> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Chirayu Desai <chirayudesai1@gmail.com>
Diffstat (limited to 'project.py')
-rwxr-xr-xproject.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/project.py b/project.py
index 24fbf4f0..a0cb5e97 100755
--- a/project.py
+++ b/project.py
@@ -2322,7 +2322,10 @@ class Project(object):
2322 spec.append('tag') 2322 spec.append('tag')
2323 spec.append(tag_name) 2323 spec.append(tag_name)
2324 2324
2325 branch = self.revisionExpr 2325 if self.manifest.IsMirror and not current_branch_only:
2326 branch = None
2327 else:
2328 branch = self.revisionExpr
2326 if (not self.manifest.IsMirror and is_sha1 and depth 2329 if (not self.manifest.IsMirror and is_sha1 and depth
2327 and git_require((1, 8, 3))): 2330 and git_require((1, 8, 3))):
2328 # Shallow checkout of a specific commit, fetch from that commit and not 2331 # Shallow checkout of a specific commit, fetch from that commit and not