chiark / gitweb /
Use origin/HEAD as the default checkout for git
[fdroidserver.git] / 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")