mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
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
36 lines
992 B
Bash
Executable File
36 lines
992 B
Bash
Executable File
#!/bin/sh
|
|
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
base_dir=$(dirname "$0")
|
|
repo="$base_dir/git-cl-repo"
|
|
url="http://src.chromium.org/git/git-cl.git"
|
|
cur_url=$(git config -f "$repo/.git/config" remote.origin.url)
|
|
|
|
if [ -e "$repo" -a "$cur_url" != "$url" ]; then
|
|
cat <<EOF
|
|
$repo
|
|
is tracking a non-default remote repository:
|
|
|
|
default: $url
|
|
yours: $cur_url
|
|
|
|
This is intended to be an automatically-updating, read-only repository.
|
|
Please create a separate repository for making changes to git-cl, move your
|
|
modifications there, and then run:
|
|
rm -rf $repo
|
|
EOF
|
|
exit 1
|
|
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 "$@"
|