Cloner: correct fetch on pre-1.9 git
Commit 6c54b531a3
changed the cloner
to use 'fetch --tags' instead of update, however, 'fetch --tags'
does not actually update heads before git version 1.9. So if we
are using old versions of git, run both commands so that we get
persistent behavior.
Change-Id: I8ea8ac2c6a8384845a3310da63974afc3279564f
This commit is contained in:
parent
176431ec14
commit
84c4f94000
|
@ -182,6 +182,13 @@ class Repo(object):
|
|||
repo = self.createRepoObject()
|
||||
self.log.debug("Updating repository %s" % self.local_path)
|
||||
origin = repo.remotes.origin
|
||||
if repo.git.version_info[:2] < (1, 9):
|
||||
# Before 1.9, 'git fetch --tags' did not include the
|
||||
# behavior covered by 'git --fetch', so we run both
|
||||
# commands in that case. Starting with 1.9, 'git fetch
|
||||
# --tags' is all that is necessary. See
|
||||
# https://github.com/git/git/blob/master/Documentation/RelNotes/1.9.0.txt#L18-L20
|
||||
origin.fetch()
|
||||
origin.fetch(tags=True)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue