run git fetch before switching branch (#46196)

This commit is contained in:
Frédéric Péters 2020-08-28 23:54:40 +02:00
parent f2d6c89b8c
commit f1028ba62b
1 changed files with 1 additions and 0 deletions

View File

@ -448,6 +448,7 @@ def setup_git_tree(project_reference, options):
existing_tree = True
branch_name = options.branch or get_git_branch_name(project_reference)
try:
subprocess.check_call(['git', 'fetch'], cwd=git_project_path)
subprocess.check_call(['git', 'checkout', '--quiet', branch_name],
cwd=git_project_path)
subprocess.check_call(['git', 'reset', '--hard', 'origin/%s' % branch_name],