OLD | NEW |
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 echo "$solution/$1" | 70 echo "$solution/$1" |
71 fi | 71 fi |
72 } | 72 } |
73 | 73 |
74 if [ -z "$*" ]; then | 74 if [ -z "$*" ]; then |
75 exit 0 | 75 exit 0 |
76 fi | 76 fi |
77 set -o pipefail | 77 set -o pipefail |
78 dir="$1" | 78 dir="$1" |
79 solution="${1%%/*}" | 79 solution="${1%%/*}" |
80 cd "$solution" | 80 cd "$solution" 1>/dev/null |
81 | 81 |
82 if [ "$solution" = "$1" ]; then | 82 if [ "$solution" = "$1" ]; then |
83 # Skip git checkouts not managed by crup. | 83 # Skip git checkouts not managed by crup. |
84 if ! grep -q -s "The Chromium Authors" ".git/description"; then | 84 if ! grep -q -s "The Chromium Authors" ".git/description"; then |
85 echo "Skipping unmanaged git directory $1" 1>&2 | 85 echo "Skipping unmanaged git directory $1" 1>&2 |
86 exit 0 | 86 exit 0 |
87 fi | 87 fi |
88 | 88 |
89 shift | 89 shift |
90 if test $# -ne 0; then | 90 if test $# -ne 0; then |
(...skipping 11 matching lines...) Expand all Loading... |
102 submodule="${1#*/}" | 102 submodule="${1#*/}" |
103 echo "[$solution] updating $submodule" | 103 echo "[$solution] updating $submodule" |
104 "$GIT_EXE" submodule update --quiet "$submodule" | | 104 "$GIT_EXE" submodule update --quiet "$submodule" | |
105 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g" | 105 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g" |
106 status=$? | 106 status=$? |
107 if [ "$status" -ne "0" ]; then | 107 if [ "$status" -ne "0" ]; then |
108 echo "[$solution] FAILED to update $submodule" | 108 echo "[$solution] FAILED to update $submodule" |
109 fi | 109 fi |
110 fi | 110 fi |
111 exit $status | 111 exit $status |
OLD | NEW |