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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 | 106 |
107 "$GIT_EXE" ls-files -s | grep ^160000 | awk '{print $4}' | | 107 "$GIT_EXE" ls-files -s | grep ^160000 | awk '{print $4}' | |
108 while read submod; do | 108 while read submod; do |
109 process_submodule "$submod" | 109 process_submodule "$submod" |
110 done | 110 done |
111 status=$? | 111 status=$? |
112 else | 112 else |
113 submodule="${1#*/}" | 113 submodule="${1#*/}" |
114 echo "[$solution] updating $submodule" | 114 echo "[$solution] updating $submodule" |
115 "$GIT_EXE" submodule update --recursive --quiet "$submodule" | | 115 "$GIT_EXE" submodule update --recursive --quiet "$submodule" | |
116 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g" | 116 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g" 2>/dev/null |
iannucci
2013/03/19 22:11:52
Can this lead to silent failures?
szager1
2013/03/20 21:47:01
The lines below that check $? should prevent compl
| |
117 status=$? | 117 status=$? |
118 if [ "$status" -ne "0" ]; then | 118 if [ "$status" -ne "0" ]; then |
119 echo "[$solution] FAILED to update $submodule" | 119 echo "[$solution] FAILED to update $submodule" |
120 fi | 120 fi |
121 fi | 121 fi |
122 exit $status | 122 exit $status |
OLD | NEW |