From: Daniel Martí Date: Wed, 25 Jun 2014 09:12:53 +0000 (+0200) Subject: Use origin/HEAD as the default checkout for git X-Git-Tag: 0.2~8 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c0f026c9c4af8ef9c4c2f4b56d68ddb78433eb11;hp=c9638cf7ddd0082a6fd7438a0defeb36e787fd47;p=fdroidserver.git Use origin/HEAD as the default checkout for git This should fix many RepoManifest UCMs where 'master' is not the default branch --- 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")