Skip to content

Commit

Permalink
Merge pull request #2400 from obfusk/fix-git-pull
Browse files Browse the repository at this point in the history
don't run git pull when not on a branch
  • Loading branch information
AndreMiras authored Jan 5, 2021
2 parents 3ed4cf0 + c6067df commit 16f1c26
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pythonforandroid/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,13 @@ def report_hook(index, blksize, size):
elif parsed_url.scheme in ('git', 'git+file', 'git+ssh', 'git+http', 'git+https'):
if isdir(target):
with current_directory(target):
shprint(sh.git, 'fetch', '--tags')
shprint(sh.git, 'fetch', '--tags', '--recurse-submodules')
if self.version:
shprint(sh.git, 'checkout', self.version)
shprint(sh.git, 'pull')
shprint(sh.git, 'pull', '--recurse-submodules')
branch = sh.git('branch', '--show-current')
if branch:
shprint(sh.git, 'pull')
shprint(sh.git, 'pull', '--recurse-submodules')
shprint(sh.git, 'submodule', 'update', '--recursive')
else:
if url.startswith('git+'):
Expand Down

0 comments on commit 16f1c26

Please sign in to comment.