[PATCH 1/3] git-submodule.sh: make some variables boolean
- From
- Roy Eldar <royeldar0@gmail.com>
- Date
- Dec 7, 2024, 13:51 UTC
- Message-ID
- <20241207135201.2536-2-royeldar0@gmail.com>
- In-Reply-To
- <20241207135201.2536-1-royeldar0@gmail.com>
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@gmail.com> --- 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