From c0f026c9c4af8ef9c4c2f4b56d68ddb78433eb11 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Mart=C3=AD?= Date: Wed, 25 Jun 2014 11:12:53 +0200 Subject: [PATCH] Use origin/HEAD as the default checkout for git This should fix many RepoManifest UCMs where 'master' is not the default branch --- fdroidserver/common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index b50c7063..48ee6dfe 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -436,8 +436,9 @@ class vcs_git(vcs): if p.returncode != 0: raise VCSException("Git fetch failed") self.refreshed = True - # Check out the appropriate revision - rev = str(rev if rev else 'origin/master') + # 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. + rev = str(rev if rev else 'origin/HEAD') p = SilentPopen(['git', 'checkout', '-f', rev], cwd=self.local) if p.returncode != 0: raise VCSException("Git checkout failed") -- 2.30.2