run git from proper directory

This commit is contained in:
Gregory Becker
2021-02-19 00:48:35 -08:00
parent d4895435f1
commit 9810572411

View File

@@ -55,10 +55,6 @@ def known_commit_or_tag(ref):
def checkout(parser, args):
deployment_required_args = {'remote': 'origin'}
deployment.setup_deployment_args('checkout', args,
deployment_required_args)
remote = args.remote or 'origin'
url = args.url
ref = args.ref
@@ -66,6 +62,7 @@ def checkout(parser, args):
global git # make git available to called methods
git = which('git', required=True)
with working_dir(spack.paths.prefix):
# Always fetch branches
branches = map(lambda b: b.strip('* '),
git('branch', output=str, error=str).split('\n'))