mirror of
https://github.com/f-droid/fdroidserver.git
synced 2026-10-23 04:37:43 -04:00
Always try to recover origin/HEAD in case it's not there
This commit is contained in:
1 parent
4ad7e8be06
commit
e49b7aafda
1 file changed
+4
@@ -435,6 +435,10 @@ class vcs_git(vcs):
|
||||
p = SilentPopen(['git', 'fetch', '--prune', '--tags', 'origin'], cwd=self.local)
|
||||
if p.returncode != 0:
|
||||
raise VCSException("Git fetch failed")
|
||||
# Recreate origin/HEAD as git clone would do it, in case it disappeared
|
||||
p = SilentPopen(['git', 'remote', 'set-head', 'origin', '--auto'], cwd=self.local)
|
||||
if p.returncode != 0:
|
||||
raise VCSException("Git remote set-head failed")
|
||||
self.refreshed = True
|
||||
# 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.
|
||||
|
||||
Reference in new issue
Block a user