diff options
author | Xin Li <delphij@google.com> | 2019-09-16 10:55:41 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2019-09-16 18:34:45 +0000 |
commit | a2cd6aeae8abb6379074964e5d75c1c3b7854bcf (patch) | |
tree | 4c3be20b6e08d3811cb3c0b6cfde8dcd3bc0005f | |
parent | 70d861fa2938d1f8f84eb8ce76ebc9f719197934 (diff) | |
download | git-repo-a2cd6aeae8abb6379074964e5d75c1c3b7854bcf.tar.gz |
Fix tag clobbering when -c is used.v1.13.6
Bug: b/140189154
Change-Id: I8861a6115b20c9a3d88ddec5344c75326ae44823
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/237572
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Xin Li <delphij@google.com>
-rwxr-xr-x | project.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2186,12 +2186,15 @@ class Project(object): | |||
2186 | cmd.append('--update-head-ok') | 2186 | cmd.append('--update-head-ok') |
2187 | cmd.append(name) | 2187 | cmd.append(name) |
2188 | 2188 | ||
2189 | spec = [] | ||
2190 | |||
2189 | # If using depth then we should not get all the tags since they may | 2191 | # If using depth then we should not get all the tags since they may |
2190 | # be outside of the depth. | 2192 | # be outside of the depth. |
2191 | if no_tags or depth: | 2193 | if no_tags or depth: |
2192 | cmd.append('--no-tags') | 2194 | cmd.append('--no-tags') |
2193 | else: | 2195 | else: |
2194 | cmd.append('--tags') | 2196 | cmd.append('--tags') |
2197 | spec.append(str((u'+refs/tags/*:') + remote.ToLocal('refs/tags/*'))) | ||
2195 | 2198 | ||
2196 | if force_sync: | 2199 | if force_sync: |
2197 | cmd.append('--force') | 2200 | cmd.append('--force') |
@@ -2202,12 +2205,9 @@ class Project(object): | |||
2202 | if submodules: | 2205 | if submodules: |
2203 | cmd.append('--recurse-submodules=on-demand') | 2206 | cmd.append('--recurse-submodules=on-demand') |
2204 | 2207 | ||
2205 | spec = [] | ||
2206 | if not current_branch_only: | 2208 | if not current_branch_only: |
2207 | # Fetch whole repo | 2209 | # Fetch whole repo |
2208 | spec.append(str((u'+refs/heads/*:') + remote.ToLocal('refs/heads/*'))) | 2210 | spec.append(str((u'+refs/heads/*:') + remote.ToLocal('refs/heads/*'))) |
2209 | if not (no_tags or depth): | ||
2210 | spec.append(str((u'+refs/tags/*:') + remote.ToLocal('refs/tags/*'))) | ||
2211 | elif tag_name is not None: | 2211 | elif tag_name is not None: |
2212 | spec.append('tag') | 2212 | spec.append('tag') |
2213 | spec.append(tag_name) | 2213 | spec.append(tag_name) |