chiark / gitweb /
Use origin/HEAD as the default checkout for git
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 25 Jun 2014 09:12:53 +0000 (11:12 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 25 Jun 2014 09:13:28 +0000 (11:13 +0200)
This should fix many RepoManifest UCMs where 'master' is not the default
branch

fdroidserver/common.py

index b50c70630e69de9f92ad2b953a593cc640d543b7..48ee6dfe392ecfd3c74c956b005ffb4503a2dd6f 100644 (file)
@@ -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")