aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/git-sync-deps
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2017-02-13 13:40:56 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-13 19:53:27 +0000
commit73eae9810314c49205fe58f541e8e49a987da1ee (patch)
tree1b7ec49efc606d59937a900f18da67ff02515c84 /tools/git-sync-deps
parent320ade43f5afd55bacdd934d5462758ddd34f8f9 (diff)
tools/git-sync-deps: less verbose when fetch is needed
Change-Id: I0ab76132b9e21544ed3dfb87bd7adc91c4c4e656 Reviewed-on: https://skia-review.googlesource.com/8387 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'tools/git-sync-deps')
-rwxr-xr-xtools/git-sync-deps15
1 files changed, 9 insertions, 6 deletions
diff --git a/tools/git-sync-deps b/tools/git-sync-deps
index 2b460cb83a..78449d9682 100755
--- a/tools/git-sync-deps
+++ b/tools/git-sync-deps
@@ -142,12 +142,15 @@ def git_checkout_to_directory(git, repo, checkoutable, directory, verbose):
sys.stdout.write('%s\n SYNC IS DISABLED.\n' % directory)
return
- if 0 == subprocess.call(
- [git, 'checkout', '--quiet', checkoutable], cwd=directory):
- # if this succeeds, skip slow `git fetch`.
- if verbose:
- status(directory, checkoutable) # Success.
- return
+ with open(os.devnull, 'w') as devnull:
+ # If this fails, we will fetch before trying again. Don't spam user
+ # with error infomation.
+ if 0 == subprocess.call([git, 'checkout', '--quiet', checkoutable],
+ cwd=directory, stderr=devnull):
+ # if this succeeds, skip slow `git fetch`.
+ if verbose:
+ status(directory, checkoutable) # Success.
+ return
# If the repo has changed, always force use of the correct repo.
# If origin already points to repo, this is a quick no-op.