diff mbox series

[RFC,05/20] git-submodule.sh: normalize parsing of --cached

Message ID RFC-patch-05.20-124c062e3a1-20220610T011725Z-avarab@gmail.com (mailing list archive)
State New, archived
Headers show
Series submodule: remove git-submodule.sh, create bare builtin/submodule.c | expand

Commit Message

Ævar Arnfjörð Bjarmason June 10, 2022, 2:01 a.m. UTC
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. In 28f9af5d25e (git-submodule summary: code framework,
2008-03-11) "$1" was assigned to it, but there was no reason to do
so. Let's undo that.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 git-submodule.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/git-submodule.sh b/git-submodule.sh
index 1b0a31b8383..20fc1b620fa 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -446,7 +446,7 @@  cmd_summary() {
 	do
 		case "$1" in
 		--cached)
-			cached="$1"
+			cached=1
 			;;
 		--files)
 			files="$1"
@@ -575,7 +575,7 @@  do
 		GIT_QUIET=1
 		;;
 	--cached)
-		cached="$1"
+		cached=1
 		;;
 	--)
 		break