Skip to content

Commit

Permalink
fix: normalize Git configuration settings
Browse files Browse the repository at this point in the history
by loading them via `git -c <name>=<value> --get <name>`.
  • Loading branch information
tomeon committed Nov 3, 2023
1 parent 53122f9 commit e270ba1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion git-redate
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,15 @@ git_config_get_cond() {
if [ -n "$from_config" ]; then
final="$from_config"
else
final="${default?}"
# Normalize the default value by sending it through the `git
# config` machinery.
final="$(git -c "${setting?}=${default?}" config "$@" --get "${setting?}")" || {
case "$?" in
128)
return 128
;;
esac
}
fi
fi

Expand Down

0 comments on commit e270ba1

Please sign in to comment.