]> git.ipfire.org Git - thirdparty/git.git/commitdiff
templates: fix deprecated type option `--bool`
authorLucius Hu <orctarorga@gmail.com>
Sun, 19 Jan 2020 22:53:32 +0000 (22:53 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Jan 2020 22:11:20 +0000 (14:11 -0800)
The `--bool` option to `git-config` is marked as historical, and users are
recommended to use `--type=bool` instead. This commit replaces all occurrences
of `--bool` in the templates.

Also note that, no other deprecated type options are found, including `--int`,
`--bool-or-int`, `--path`, or `--expiry-date`.

Signed-off-by: Lucius Hu <orctarorga@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
templates/hooks--pre-commit.sample
templates/hooks--update.sample

index 6a756416384c210ada2631f17862f5c01fffa478..e144712c85c055bcf3248ab342592b440a477062 100755 (executable)
@@ -16,7 +16,7 @@ else
 fi
 
 # If you want to allow non-ASCII filenames set this variable to true.
-allownonascii=$(git config --bool hooks.allownonascii)
+allownonascii=$(git config --type=bool hooks.allownonascii)
 
 # Redirect output to stderr.
 exec 1>&2
index 80ba94135cc378364af9d3cb2450df48e51faf2c..5014c4b31cb9700dbd458c8841d8cd91d3b8773c 100755 (executable)
@@ -43,11 +43,11 @@ if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
 fi
 
 # --- Config
-allowunannotated=$(git config --bool hooks.allowunannotated)
-allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
-denycreatebranch=$(git config --bool hooks.denycreatebranch)
-allowdeletetag=$(git config --bool hooks.allowdeletetag)
-allowmodifytag=$(git config --bool hooks.allowmodifytag)
+allowunannotated=$(git config --type=bool hooks.allowunannotated)
+allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch)
+denycreatebranch=$(git config --type=bool hooks.denycreatebranch)
+allowdeletetag=$(git config --type=bool hooks.allowdeletetag)
+allowmodifytag=$(git config --type=bool hooks.allowmodifytag)
 
 # check for no description
 projectdesc=$(sed -e '1q' "$GIT_DIR/description")