From c6067df667f2c413c910fece2c43226876b30de6 Mon Sep 17 00:00:00 2001 From: "Felix C. Stegerman" Date: Mon, 4 Jan 2021 20:58:38 +0100 Subject: [PATCH] don't run git pull when not on a branch --- pythonforandroid/recipe.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pythonforandroid/recipe.py b/pythonforandroid/recipe.py index a9569d2ec1..f07a412fbf 100644 --- a/pythonforandroid/recipe.py +++ b/pythonforandroid/recipe.py @@ -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+'):