From a71a5c0bd914cc41dc21571fd9f80a6502164512 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 14 Jun 2022 07:10:19 +0200 Subject: Changing default value handling for variables in git-whoami to more portable format. Signed-off-by: Daniel Baumann --- git/bin/git-whoami | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'git/bin') diff --git a/git/bin/git-whoami b/git/bin/git-whoami index bf1645d..954a5ba 100755 --- a/git/bin/git-whoami +++ b/git/bin/git-whoami @@ -17,10 +17,10 @@ get_name() { git config user.name || getent passwd "$(id -un)" | cut -d : -f 5 | cut -d , -f 1 } -: ${GIT_AUTHOR_NAME=$(get_name)} -: ${GIT_COMMITTER_NAME=$(get_name)} -: ${GIT_AUTHOR_EMAIL=$(get_email)} -: ${GIT_COMMITTER_EMAIL=$(get_email)} +GIT_AUTHOR_NAME="${GIT_AUTHOR_NAME:-$(get_name)}" +GIT_AUTHOR_EMAIL="${GIT_AUTHOR_EMAIL:-$(get_email)}" +GIT_COMMITTER_NAME="${GIT_COMMITER_NAME:-$(get_name)}" +GIT_COMMITTER_EMAIL="${GIT_COMMITER_EMAIL:-$(get_email)}" author="$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>" commit="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" -- cgit v1.2.3