[PATCH 1/3] git-submodule.sh: make some variables boolean

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When git-submodule.sh parses various options and switchs, 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.

There are 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 throught
the script and reduce possible confusion.

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

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"
-- 
2.30.2





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux