]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-submodule.sh: make the "$cached" variable a boolean
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 28 Jun 2022 10:05:25 +0000 (12:05 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Jun 2022 20:13:17 +0000 (13:13 -0700)
Remove the assignment of "$1" to the "$cached" variable. As seen in
the initial implementation in 70c7ac22de6 (Add git-submodule command,
2007-05-26) we only need to keep track of if we've seen the --cached
option, not save the "--cached" string for later use.

In 28f9af5d25e (git-submodule summary: code framework, 2008-03-11)
"$1" was assigned to it, but since there was no reason to do so let's
stop doing it. This trivial change will make it easier to reason about
an eventual change that'll remove the cmd_summary() function in favor
of dispatching to "git submodule--helper summary" directly.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh

index 53847bbf6e236d8251da5a5288bf7d627978dd89..b99a00d9f841948cd1b2e1db02a5852c4b195e40 100755 (executable)
@@ -446,7 +446,7 @@ cmd_summary() {
        do
                case "$1" in
                --cached)
-                       cached="$1"
+                       cached=1
                        ;;
                --files)
                        files="$1"
@@ -583,7 +583,7 @@ do
                branch="$2"; shift
                ;;
        --cached)
-               cached="$1"
+               cached=1
                ;;
        --)
                break