1
0
mirror of https://github.com/git/git.git synced 2024-09-24 23:21:35 +02:00

git-submodule.sh: make the "$cached" variable a boolean

Remove the assignment of "$1" to the "$cached" variable. As seen in
the initial implementation in 70c7ac22de (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 28f9af5d25 (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>
This commit is contained in:
Ævar Arnfjörð Bjarmason 2022-06-28 12:05:25 +02:00 committed by Junio C Hamano
parent 960fad98e8
commit 757d092797

View File

@ -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