Skip to content

Commit

Permalink
templates: fix deprecated type option --bool
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
lebensterben authored and gitster committed Jan 21, 2020
1 parent a7312d1 commit 81e3db4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion templates/hooks--pre-commit.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions templates/hooks--update.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 81e3db4

Please sign in to comment.