Use origin/HEAD as the default checkout for git

This should fix many RepoManifest UCMs where 'master' is not the default
branch
This commit is contained in:
Daniel Martí 2014-06-25 11:12:53 +02:00
parent c9638cf7dd
commit c0f026c9c4

View file

@ -436,8 +436,9 @@ class vcs_git(vcs):
if p.returncode != 0: if p.returncode != 0:
raise VCSException("Git fetch failed") raise VCSException("Git fetch failed")
self.refreshed = True self.refreshed = True
# Check out the appropriate revision # origin/HEAD is the HEAD of the remote, e.g. the "default branch" on
rev = str(rev if rev else 'origin/master') # 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) p = SilentPopen(['git', 'checkout', '-f', rev], cwd=self.local)
if p.returncode != 0: if p.returncode != 0:
raise VCSException("Git checkout failed") raise VCSException("Git checkout failed")