Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: git-cl

Issue 3817011: Isolate depot_tools update into a separate script. (Closed)
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gclient ('k') | update_depot_tools » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 base_dir=$(dirname "$0") 6 base_dir=$(dirname "$0")
7 repo="$base_dir/git_cl_repo" 7 repo="$base_dir/git_cl_repo"
8 url="http://git.chromium.org/git/git-cl.git" 8 url="http://git.chromium.org/git/git-cl.git"
9 cur_url=$(git config -f "$repo/.git/config" remote.origin.url) 9 cur_url=$(git config -f "$repo/.git/config" remote.origin.url)
10 10
11 "$base_dir"/update_depot_tools
12
11 if [ -e "$repo" -a "$cur_url" != "$url" ]; then 13 if [ -e "$repo" -a "$cur_url" != "$url" ]; then
12 # Always override "origin" 14 # Always override "origin"
13 (cd "$repo"; git remote set-url origin $url) 15 (cd "$repo"; git remote set-url origin $url)
14 fi 16 fi
15 17
16 if [ ! -f "$repo/git-cl" ]; then 18 if [ ! -f "$repo/git-cl" ]; then
17 git clone $url $repo -q 19 git clone $url $repo -q
18 elif [ ! -e "$repo/.git" ]; then 20 elif [ ! -e "$repo/.git" ]; then
19 echo "$0: $repo does not appear to be a git repo" 21 echo "$0: $repo does not appear to be a git repo"
20 elif [ "X$DEPOT_TOOLS_UPDATE" != "X0" ]; then 22 elif [ "X$DEPOT_TOOLS_UPDATE" != "X0" ]; then
21 (cd "$repo"; git pull -q) 23 (cd "$repo"; git pull -q)
22 fi 24 fi
23 25
24 $repo/git-cl "$@" 26 $repo/git-cl "$@"
OLDNEW
« no previous file with comments | « gclient ('k') | update_depot_tools » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698