aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/git-sync-deps
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-11-24 13:10:52 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-24 13:10:52 -0800
commit8b6ab36940109b058e67a1f58274088c80f291bf (patch)
treeb7dc833f3358af4ab492494b810cb6f52fccac06 /tools/git-sync-deps
parent11a7f7f5998cb3d5605741e37a7f12f7477d480c (diff)
tools/git-sync-deps: handle changing origin
TBR=mtklein@google.com Review URL: https://codereview.chromium.org/1475513004
Diffstat (limited to 'tools/git-sync-deps')
-rwxr-xr-xtools/git-sync-deps7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/git-sync-deps b/tools/git-sync-deps
index 92adf4e855..c99ae91207 100755
--- a/tools/git-sync-deps
+++ b/tools/git-sync-deps
@@ -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.