From 05d377217d5772fa1fbec11432f6dcba13dd81f3 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Thu, 9 Jan 2020 17:19:35 +0000 Subject: [PATCH] Run git commands in the right repo --- install_gadget.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/install_gadget.py b/install_gadget.py index 8de8c16..f56d48f 100755 --- a/install_gadget.py +++ b/install_gadget.py @@ -498,14 +498,14 @@ def MakeSymlink( in_folder, link, pointing_to ): def CloneRepoTo( url, ref, destination ): RemoveIfExists( destination ) + git_in_repo = [ 'git', '-C', destination ] subprocess.check_call( [ 'git', 'clone', url, destination ] ) - subprocess.check_call( [ 'git', '-C', destination, 'checkout', ref ] ) - subprocess.check_call( [ 'git', 'submodule', 'sync', '--recursive' ] ) - subprocess.check_call( [ 'git', - 'submodule', - 'update', - '--init', - '--recursive' ] ) + subprocess.check_call( git_in_repo + [ 'checkout', ref ] ) + subprocess.check_call( git_in_repo + [ 'submodule', 'sync', '--recursive' ] ) + subprocess.check_call( git_in_repo + [ 'submodule', + 'update', + '--init', + '--recursive' ] ) OS = install.GetOS()