respect branch if specified on command line (#44491)
This commit is contained in:
parent
f7fc82a4cb
commit
6704539ab5
|
@ -441,7 +441,7 @@ def setup_git_tree(project_reference, options):
|
|||
shutil.rmtree(git_project_path)
|
||||
if os.path.exists(git_project_path):
|
||||
existing_tree = True
|
||||
branch_name = get_git_branch_name(project_reference)
|
||||
branch_name = options.branch or get_git_branch_name(project_reference)
|
||||
try:
|
||||
subprocess.check_call(['git', 'checkout', '--quiet', branch_name],
|
||||
cwd=git_project_path)
|
||||
|
@ -463,6 +463,9 @@ def setup_git_tree(project_reference, options):
|
|||
else:
|
||||
project_url = project_reference
|
||||
call("git clone %s" % project_url)
|
||||
if options.branch:
|
||||
subprocess.check_call(['git', 'checkout', '--quiet', branch_name],
|
||||
cwd=git_project_path)
|
||||
branch_name = get_git_branch_name(project_reference)
|
||||
|
||||
if not options.branch:
|
||||
|
|
Loading…
Reference in New Issue