git fetch --tags overwrites normal fetching with git < 1.8.x so do a normal fetch followed by using the refspec format for fetching tags

This commit is contained in:
Toshio Kuratomi 2014-12-22 15:08:25 -08:00 committed by Matt Clay
parent 73b7d6ea7b
commit 1be539d870

View file

@ -484,12 +484,14 @@ def fetch(git_path, module, repo, dest, version, remote, bare, refspec):
refspecs.append(refspec) refspecs.append(refspec)
commands.append((fetch_str, [git_path, 'fetch', remote] + refspecs)) commands.append((fetch_str, [git_path, 'fetch', remote] + refspecs))
else: else:
commands.append((fetch_str, [git_path, 'fetch', '--tags'])) # unlike in bare mode, there's no way to combine the
# additional refspec with the default git fetch behavior,
# so use two commands
commands.append((fetch_str, [git_path, 'fetch', remote]))
refspecs = ['+refs/tags/*:refs/tags/*']
if refspec: if refspec:
# unlike in bare mode, there's no way to combine the refspecs.append(refspec)
# additional refspec with the default git fetch behavior, commands.append((fetch_str, [git_path, 'fetch', remote] + refspecs))
# so use two commands
commands.append((fetch_str, [git_path, 'fetch', remote, refspec]))
for (label,command) in commands: for (label,command) in commands:
(rc,out,err) = module.run_command(command, cwd=dest) (rc,out,err) = module.run_command(command, cwd=dest)