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

Side by Side Diff: crup-runner.sh

Issue 116583003: Update submodule url unequivocally. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 update_toplevel () { 3 update_toplevel () {
4 # Don't "pull" if checkout is not on a named branch 4 # Don't "pull" if checkout is not on a named branch
5 if test "$2" = "pull" && ( ! git symbolic-ref HEAD >/dev/null 2>/dev/null ); t hen 5 if test "$2" = "pull" && ( ! git symbolic-ref HEAD >/dev/null 2>/dev/null ); t hen
6 first_args="$1 fetch" 6 first_args="$1 fetch"
7 else 7 else
8 first_args="$1 $2" 8 first_args="$1 $2"
9 fi 9 fi
10 shift 2 10 shift 2
(...skipping 22 matching lines...) Expand all
33 git config target.os "$target_os" 33 git config target.os "$target_os"
34 fi 34 fi
35 } 35 }
36 36
37 update_submodule_url () { 37 update_submodule_url () {
38 # If the submodule's URL in .gitmodules has changed, propagate the new 38 # If the submodule's URL in .gitmodules has changed, propagate the new
39 # new URL down. This is the same as `git submodule sync`, but we do it 39 # new URL down. This is the same as `git submodule sync`, but we do it
40 # this way because `git submodule sync` is absurdly slow. 40 # this way because `git submodule sync` is absurdly slow.
41 new_url=$(git config -f .gitmodules "submodule.$1.url" 2>/dev/null) 41 new_url=$(git config -f .gitmodules "submodule.$1.url" 2>/dev/null)
42 old_url=$(git config "submodule.$1.url" 2>/dev/null) 42 old_url=$(git config "submodule.$1.url" 2>/dev/null)
43 if [ -n "$old_url" -a "$new_url" != "$old_url" ]; then 43 if [ "$new_url" != "$old_url" ]; then
44 git config "submodule.$1.url" "$new_url" 44 git config "submodule.$1.url" "$new_url"
45 if [ -e "$1"/.git ]; then 45 if [ -e "$1"/.git ]; then
46 ( cd $submod && git config remote.origin.url "$new_url" ) 46 ( cd $submod && git config remote.origin.url "$new_url" )
47 fi 47 fi
48 fi 48 fi
49 } 49 }
50 50
51 process_submodule () { 51 process_submodule () {
52 # Check whether this submodule should be ignored or updated. 52 # Check whether this submodule should be ignored or updated.
53 # If it's a new submodule, match the os specified in .gitmodules against 53 # If it's a new submodule, match the os specified in .gitmodules against
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 submodule="${1#*/}" 119 submodule="${1#*/}"
120 echo "[$solution] updating $submodule" 120 echo "[$solution] updating $submodule"
121 git submodule update --recursive --quiet "$submodule" | 121 git submodule update --recursive --quiet "$submodule" |
122 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g" 2>/dev/null 122 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g" 2>/dev/null
123 status=$? 123 status=$?
124 if [ "$status" -ne "0" ]; then 124 if [ "$status" -ne "0" ]; then
125 echo "[$solution] FAILED to update $submodule" 125 echo "[$solution] FAILED to update $submodule"
126 fi 126 fi
127 fi 127 fi
128 exit $status 128 exit $status
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698