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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 fi | 97 fi |
98 | 98 |
99 # Don't "pull" if checkout is not on a named branch | 99 # Don't "pull" if checkout is not on a named branch |
100 shift | 100 shift |
101 if test $# -ne 0; then | 101 if test $# -ne 0; then |
102 update_toplevel "$@" | 102 update_toplevel "$@" |
103 fi | 103 fi |
104 | 104 |
105 set_target_os | 105 set_target_os |
106 | 106 |
107 "$GIT_EXE" ls-files -s | grep ^160000 | awk '{print $4}' | | 107 git 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 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 |
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 |