git force fetch tags

The behaviour of fetching tags changed in git 2.20. We need to force
fetch tags to restore the earlier behaviour and make fdroid git
operations work with newer git versions.

Closes fdroid/fdroidserver#718
This commit is contained in:
Marcus Hoffmann 2019-12-23 14:48:52 +01:00
parent e9830fc4ab
commit 3403402fbc

View file

@ -906,7 +906,7 @@ class vcs_git(vcs):
p = self.git(['fetch', 'origin'], cwd=self.local) p = self.git(['fetch', 'origin'], cwd=self.local)
if p.returncode != 0: if p.returncode != 0:
raise VCSException(_("Git fetch failed"), p.output) raise VCSException(_("Git fetch failed"), p.output)
p = self.git(['fetch', '--prune', '--tags', 'origin'], output=False, cwd=self.local) p = self.git(['fetch', '--prune', '--tags', '--force', 'origin'], output=False, cwd=self.local)
if p.returncode != 0: if p.returncode != 0:
raise VCSException(_("Git fetch failed"), p.output) raise VCSException(_("Git fetch failed"), p.output)
# Recreate origin/HEAD as git clone would do it, in case it disappeared # Recreate origin/HEAD as git clone would do it, in case it disappeared