mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 07:52:35 +03:00
Always try to recover origin/HEAD in case it's not there
This commit is contained in:
parent
4ad7e8be06
commit
e49b7aafda
1 changed files with 4 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue