Skip to content

Commit 16f1c26

Browse files
authored
Merge pull request kivy#2400 from obfusk/fix-git-pull
don't run git pull when not on a branch
2 parents 3ed4cf0 + c6067df commit 16f1c26

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pythonforandroid/recipe.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,13 @@ def report_hook(index, blksize, size):
220220
elif parsed_url.scheme in ('git', 'git+file', 'git+ssh', 'git+http', 'git+https'):
221221
if isdir(target):
222222
with current_directory(target):
223-
shprint(sh.git, 'fetch', '--tags')
223+
shprint(sh.git, 'fetch', '--tags', '--recurse-submodules')
224224
if self.version:
225225
shprint(sh.git, 'checkout', self.version)
226-
shprint(sh.git, 'pull')
227-
shprint(sh.git, 'pull', '--recurse-submodules')
226+
branch = sh.git('branch', '--show-current')
227+
if branch:
228+
shprint(sh.git, 'pull')
229+
shprint(sh.git, 'pull', '--recurse-submodules')
228230
shprint(sh.git, 'submodule', 'update', '--recursive')
229231
else:
230232
if url.startswith('git+'):

0 commit comments

Comments
 (0)