From d065eccd01fd9d73cad8adba9606c0e9c939d748 Mon Sep 17 00:00:00 2001 From: "msb@chromium.org" Date: Tue, 13 Jul 2010 22:46:06 +0000 Subject: [PATCH] gclient: update git-cl whenever git-cl is run and not when gclient is run Rather than updating git-cl whenever gclient is invoked, update it whenever git-cl is invoked. In the chromium-os workflow, folks often run git-cl but rarely run gclient. This results in folks running an older git-cl which may not have the latest features/fixes. TEST= Tested that git-cl is updated when it is stale, git-cl is cloned when it doesn't exist and is not updated when DEPOT_TOOLS_UPDATE=0 Review URL: http://codereview.chromium.org/2962013 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@52236 0039d316-1c4b-4281-b951-d872f2087c98 --- gclient | 6 ------ git-cl | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/gclient b/gclient index a4efb3ca1..34478dc29 100755 --- a/gclient +++ b/gclient @@ -52,12 +52,6 @@ then cd - > /dev/null fi -if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/git-cl-repo/.git" ] -then - test_git - (cd "$base_dir/git-cl-repo"; git pull -q) -fi - # Use the batch file as an entry point if on cygwin. if [ "${OSTYPE}" = "cygwin" -a "${TERM}" != "xterm" ]; then ${base_dir}/gclient.bat "$@" diff --git a/git-cl b/git-cl index babe5ace3..4c568f7b6 100755 --- a/git-cl +++ b/git-cl @@ -26,6 +26,10 @@ fi if [ ! -f "$repo/git-cl" ]; then git clone $url $repo -q +elif [ ! -e "$base_dir/git-cl-repo/.git" ]; then + echo "$0: $base_dir/git-cl-repo does not appear to be a git repo" +elif [ "X$DEPOT_TOOLS_UPDATE" != "X0" ]; then + (cd "$base_dir/git-cl-repo"; git pull -q) fi $repo/git-cl "$@"