submodule: clean up substitutions in script
authorCasey Fitzpatrick <kcghost@gmail.com>
Thu, 3 May 2018 10:53:44 +0000 (06:53 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 May 2018 03:16:31 +0000 (12:16 +0900)
'recommend_shallow' and 'jobs' variables do not need quotes. They only hold a
single token value, and even if they were multi-token it is likely we would want
them split at IFS rather than pass a single string.

'progress' is a boolean value. Treat it like the other boolean values in the
script by using a substitution.

Signed-off-by: Casey Fitzpatrick <kcghost@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh
index 24914963ca23c837e0cc46ca2dc0fa46bf9886a6..2625479684266c3e453de56c73e9e1b4dc23e08e 100755 (executable)
@@ -465,7 +465,7 @@ cmd_update()
                        GIT_QUIET=1
                        ;;
                --progress)
-                       progress="--progress"
+                       progress=1
                        ;;
                -i|--init)
                        init=1
@@ -542,14 +542,14 @@ cmd_update()
 
        {
        git submodule--helper update-clone ${GIT_QUIET:+--quiet} \
-               ${progress:+"$progress"} \
+               ${progress:+"--progress"} \
                ${wt_prefix:+--prefix "$wt_prefix"} \
                ${prefix:+--recursive-prefix "$prefix"} \
                ${update:+--update "$update"} \
                ${reference:+"$reference"} \
                ${depth:+--depth "$depth"} \
-               ${recommend_shallow:+"$recommend_shallow"} \
-               ${jobs:+$jobs} \
+               $recommend_shallow \
+               $jobs \
                "$@" || echo "#unmatched" $?
        } | {
        err=