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

pull/18777/head
Toshio Kuratomi 10 years ago committed by Matt Clay
parent 73b7d6ea7b
commit 1be539d870

@ -484,12 +484,14 @@ def fetch(git_path, module, repo, dest, version, remote, bare, refspec):
refspecs.append(refspec)
commands.append((fetch_str, [git_path, 'fetch', remote] + refspecs))
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:
# 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, refspec]))
refspecs.append(refspec)
commands.append((fetch_str, [git_path, 'fetch', remote] + refspecs))
for (label,command) in commands:
(rc,out,err) = module.run_command(command, cwd=dest)

Loading…
Cancel
Save