summaryrefslogtreecommitdiffstats
path: root/git/bin/git-whoami
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-06-14 05:10:19 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-06-14 11:59:26 +0000
commita71a5c0bd914cc41dc21571fd9f80a6502164512 (patch)
treeec7f3f0a4d4b1cc1dd5b41e5faff57611162dae0 /git/bin/git-whoami
parentAdding quotes arround some variables in git-tools to prevent globbing and wor... (diff)
downloadservice-tools-a71a5c0bd914cc41dc21571fd9f80a6502164512.tar.xz
service-tools-a71a5c0bd914cc41dc21571fd9f80a6502164512.zip
Changing default value handling for variables in git-whoami to more portable format.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'git/bin/git-whoami')
-rwxr-xr-xgit/bin/git-whoami8
1 files changed, 4 insertions, 4 deletions
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>"