Index: tools/git-sync-deps |
diff --git a/tools/git-sync-deps b/tools/git-sync-deps |
index 92adf4e855483807b8ebeed89a155451462b9fee..c99ae9120727abdd17a3163743d0506f0c57e10c 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. |