do not set global values for git variables

This commit is contained in:
Lucas Frérot 2024-12-31 13:35:11 +01:00
parent 2781ddf6a3
commit e074531163
No known key found for this signature in database
GPG Key ID: 03B54A50E3FBA7E8
1 changed files with 3 additions and 3 deletions

View File

@ -152,15 +152,15 @@ set_git_config() {
while ! [[ -n "${value}" ]]; do while ! [[ -n "${value}" ]]; do
value="$(enter "new value for ${param}: ")" value="$(enter "new value for ${param}: ")"
done done
\git config --global "${param}" "${value}" \git config "${param}" "${value}"
info "setting new value for ${param}: '$(git config "${param}")'" info "setting new value for ${param}: '$(\git config "${param}")'"
printf "${value}" printf "${value}"
} }
# Get value of git config parameter, set if unset # Get value of git config parameter, set if unset
get_git_config() { get_git_config() {
local param="$1" local param="$1"
local value="$(git config "${param}")" local value="$(\git config "${param}")"
if ! [[ -n "${value}" ]]; then if ! [[ -n "${value}" ]]; then
warning "git ${param} is unset" warning "git ${param} is unset"
value="$(set_git_config "${param}")" value="$(set_git_config "${param}")"