diff mbox series

[v2,1/8] git-submodule.sh: make some variables boolean

Message ID 20241209165009.40653-2-royeldar0@gmail.com (mailing list archive)
State Superseded
Headers show
Series git-submodule.sh: improve parsing of options | expand

Commit Message

Roy Eldar Dec. 9, 2024, 4:50 p.m. UTC
When git-submodule.sh parses various options and switches, it sets some
variables to values; in particular, every switch that is passed causes a
corresponding variable to be set to 1, which then affects the options
given to git-submodule--helper.

Some variables are assigned "$1", although there is no reason for it;
this was actually noticed in 757d092 for the "$cached" variable.

Make some variables boolean, in order to increase consistency throughout
the script and reduce possible confusion.

Signed-off-by: Roy Eldar <royeldar0@gmail.com>
---
 git-submodule.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/git-submodule.sh b/git-submodule.sh
index 03c5a220a2..107011f613 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -78,7 +78,7 @@  cmd_add()
 			shift
 			;;
 		-f | --force)
-			force=$1
+			force=1
 			;;
 		-q|--quiet)
 			quiet=1
@@ -231,7 +231,7 @@  cmd_deinit()
 	do
 		case "$1" in
 		-f|--force)
-			force=$1
+			force=1
 			;;
 		-q|--quiet)
 			quiet=1
@@ -294,7 +294,7 @@  cmd_update()
 			nofetch=1
 			;;
 		-f|--force)
-			force=$1
+			force=1
 			;;
 		-r|--rebase)
 			rebase=1
@@ -500,10 +500,10 @@  cmd_summary() {
 			cached=1
 			;;
 		--files)
-			files="$1"
+			files=1
 			;;
 		--for-status)
-			for_status="$1"
+			for_status=1
 			;;
 		-n|--summary-limit)
 			summary_limit="$2"