diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-04-23 17:27:58 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-04-23 17:27:58 +0200 |
commit | 63bc8d7b34cd0ed089a58473332323b180a438ce (patch) | |
tree | d4b5c8d2798b53b7599fad5c5dd6b9ac9db619b4 /check | |
parent | bf3ebb41333cef376cdeeff610a2097db7831a0e (diff) |
Handle recursive submodules in check script
Diffstat (limited to 'check')
-rwxr-xr-x | check | 31 |
1 files changed, 26 insertions, 5 deletions
@@ -75,17 +75,38 @@ if [ "$master" = "y" ]; then fi fi -if [ "$submod" = "y" ]; then - sms=`git -C $dir submodule foreach --quiet --recursive 'echo $path'` +function submod () # <dir> +{ + # The --recursive option doesn't produce the complete path so we will + # have to recurse ourselves. + # + local sms=`git -C $1 submodule foreach --quiet 'echo -n "$path "'` + + #info "checking '$sms' in $1..." + + local sm= for sm in $sms; do - smd=$dir/$sm - br=`branch $smd` + local smd=$1/$sm + + #info "sumbodule '$sm' in '$smd'" + + local br=`branch $smd` if ! synced $smd $br; then info "submodule $smd is not updated" - r=1 + return 1 + fi + + if ! submod $smd; then + return 1 fi done +} + +if [ "$submod" = "y" ]; then + if ! submod $dir; then + r=1 + fi fi if [ "$clean" = "y" ]; then |