mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 06:52:39 +03:00
Better git handling, particularly if the master branch disappears
This commit is contained in:
parent
938b5cbbad
commit
0121c70763
1 changed files with 3 additions and 4 deletions
|
@ -76,6 +76,8 @@ class vcs:
|
||||||
assert False # Must be defined in child
|
assert False # Must be defined in child
|
||||||
|
|
||||||
# Get new commits from the remote repository. Local must be clean.
|
# Get new commits from the remote repository. Local must be clean.
|
||||||
|
# Fetch would really be a better name, as this doesn't necessarily
|
||||||
|
# (depending on the vcs) affect the local source tree or HEAD!
|
||||||
def pull(self):
|
def pull(self):
|
||||||
assert False # Must be defined in child
|
assert False # Must be defined in child
|
||||||
|
|
||||||
|
@ -109,11 +111,8 @@ class vcs_git(vcs):
|
||||||
|
|
||||||
def pull(self):
|
def pull(self):
|
||||||
self.checkrepo()
|
self.checkrepo()
|
||||||
if subprocess.call(['git', 'pull', 'origin'],
|
|
||||||
cwd=self.local) != 0:
|
|
||||||
raise VCSException("Git pull failed")
|
|
||||||
# Might need tags that aren't on a branch.
|
# Might need tags that aren't on a branch.
|
||||||
if subprocess.call(['git', 'fetch', '--tags', 'origin'],
|
if subprocess.call(['git', 'fetch', '--all', '--tags', 'origin'],
|
||||||
cwd=self.local) != 0:
|
cwd=self.local) != 0:
|
||||||
raise VCSException("Git fetch failed")
|
raise VCSException("Git fetch failed")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue