From 73eae9810314c49205fe58f541e8e49a987da1ee Mon Sep 17 00:00:00 2001 From: Hal Canary Date: Mon, 13 Feb 2017 13:40:56 -0500 Subject: 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 Commit-Queue: Hal Canary --- tools/git-sync-deps | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'tools/git-sync-deps') 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. -- cgit v1.2.3