tools/git-sync-deps: handle changing origin
TBR=mtklein@google.com Review URL: https://codereview.chromium.org/1475513004
This commit is contained in:
parent
11a7f7f599
commit
8b6ab36940
@ -142,8 +142,11 @@ def git_checkout_to_directory(git, repo, checkoutable, directory, verbose):
|
||||
|
||||
subprocess.check_call([git, 'fetch', '--quiet'], cwd=directory)
|
||||
|
||||
subprocess.check_call(
|
||||
[git, 'checkout', '--quiet', checkoutable], cwd=directory)
|
||||
if 0 != subprocess.call(
|
||||
[git, 'checkout', '--quiet', checkoutable], cwd=directory):
|
||||
subprocess.check_call([git, 'remote', 'set-url', repo], cwd=directory)
|
||||
subprocess.check_call([git, 'fetch', '--quiet'], cwd=directory)
|
||||
subprocess.check_call([git, 'checkout', '--quiet'], cwd=directory)
|
||||
|
||||
if verbose:
|
||||
sys.stdout.write('%s\n @ %s\n' % (directory, checkoutable)) # Success.
|
||||
|
Loading…
Reference in New Issue
Block a user