diff options
author | Chirayu Desai <chirayudesai1@gmail.com> | 2020-02-04 17:50:57 +0530 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2020-02-06 09:19:35 -0500 |
commit | ab15e42fa4403a0354c936d8740f864300b00929 (patch) | |
tree | b234b5d4e1c2e7539c4635843c7d8c12cd82939d /project.py | |
parent | 75c02fe4cb5a22135e292c3083220e1f3d4cb349 (diff) | |
download | git-repo-ab15e42fa4403a0354c936d8740f864300b00929.tar.gz |
Do not try to fetch default revision for mirrors alwaysv1.13.9.3
* 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>
(cherry picked from commit f7b64e3350a622ee87e1927cdbc8d854a5696d85)
Diffstat (limited to 'project.py')
-rwxr-xr-x | project.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -2252,7 +2252,10 @@ class Project(object): | |||
2252 | spec.append('tag') | 2252 | spec.append('tag') |
2253 | spec.append(tag_name) | 2253 | spec.append(tag_name) |
2254 | 2254 | ||
2255 | branch = self.revisionExpr | 2255 | if self.manifest.IsMirror and not current_branch_only: |
2256 | branch = None | ||
2257 | else: | ||
2258 | branch = self.revisionExpr | ||
2256 | if (not self.manifest.IsMirror and is_sha1 and depth | 2259 | if (not self.manifest.IsMirror and is_sha1 and depth |
2257 | and git_require((1, 8, 3))): | 2260 | and git_require((1, 8, 3))): |
2258 | # Shallow checkout of a specific commit, fetch from that commit and not | 2261 | # Shallow checkout of a specific commit, fetch from that commit and not |