From e49b7aafda14a24457d33964fac7757c24d2b712 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Mart=C3=AD?= Date: Thu, 26 Jun 2014 13:03:51 +0200 Subject: [PATCH 1/1] Always try to recover origin/HEAD in case it's not there --- fdroidserver/common.py | 4 ++++ 1 file changed, 4 insertions(+) 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. -- 2.30.2