Explicitly allow clobbering tags when fetching from remote.

Bug: b/139860049
Change-Id: I3c4134eda7e9e75c9d72b233e269bcc0e624d1e8
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/234632
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Xin Li <delphij@google.com>
This commit is contained in:
Xin Li 2019-08-22 10:00:27 -07:00
parent d5c306b404
commit 3069be2684

View File

@ -2201,6 +2201,8 @@ class Project(object):
if not current_branch_only:
# Fetch whole repo
spec.append(str((u'+refs/heads/*:') + remote.ToLocal('refs/heads/*')))
if not (no_tags or depth):
spec.append(str((u'+refs/tags/*:') + remote.ToLocal('refs/tags/*')))
elif tag_name is not None:
spec.append('tag')
spec.append(tag_name)