From: Daniel Martí Date: Thu, 26 Jun 2014 11:03:51 +0000 (+0200) Subject: Always try to recover origin/HEAD in case it's not there X-Git-Tag: 0.2~2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=e49b7aafda14a24457d33964fac7757c24d2b712;p=fdroidserver.git Always try to recover origin/HEAD in case it's not there --- diff --git a/fdroidserver/common.py b/fdroidserver/common.py index bdc6da2e..3396e93a 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -435,6 +435,10 @@ class vcs_git(vcs): p = SilentPopen(['git', 'fetch', '--prune', '--tags', 'origin'], cwd=self.local) if p.returncode != 0: raise VCSException("Git fetch failed") + # Recreate origin/HEAD as git clone would do it, in case it disappeared + p = SilentPopen(['git', 'remote', 'set-head', 'origin', '--auto'], cwd=self.local) + if p.returncode != 0: + raise VCSException("Git remote set-head failed") self.refreshed = True # origin/HEAD is the HEAD of the remote, e.g. the "default branch" on # a github repo. Most of the time this is the same as origin/master.