west update: clean up helper procedure

There's no need for the call_location variable in update_submodules();
Project.git() runs in the project's abspath by default.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2021-01-11 16:54:11 -08:00 committed by Marti Bolivar
parent 16f071d4f0
commit 77c093203c
1 changed files with 2 additions and 3 deletions

View File

@ -932,18 +932,17 @@ class Update(_ProjectCommand):
return
submodules = project.submodules
call_location = os.path.join(self.topdir, project.path)
submodules_update_strategy = ('--rebase' if self.args.rebase
else '--checkout')
# For the list type, update given list of submodules.
if isinstance(submodules, list):
for submodule in submodules:
project.git(['-C', call_location, 'submodule', 'update',
project.git(['submodule', 'update',
'--init', submodules_update_strategy,
'--recursive', submodule.path])
# For the bool type, update all project submodules
elif isinstance(submodules, bool):
project.git(['-C', call_location, 'submodule', 'update', '--init',
project.git(['submodule', 'update', '--init',
submodules_update_strategy, '--recursive'])
def update(self, project):