Browse Source

Merge topic 'git-var'

5129e97285 setup-user: switch to git-var to check if username and e-mail are set

Acked-by: Kitware Robot <[email protected]>
Merge-request: !4084
Brad King 6 years ago
parent
commit
e17934c183
1 changed files with 4 additions and 4 deletions
  1. 4 4
      Utilities/GitSetup/setup-user

+ 4 - 4
Utilities/GitSetup/setup-user

@@ -20,12 +20,12 @@
 # Project configuration instructions: NONE
 
 for (( ; ; )); do
-	user_name=$(git config user.name || echo '') &&
-	user_email=$(git config user.email || echo '') &&
-	if test -n "$user_name" -a -n "$user_email"; then
+	ident="$(git var GIT_AUTHOR_IDENT 2>/dev/null | rev | cut -d' ' -f3- | rev)"
+
+	if test -n "$ident"; then
 		echo 'Your commits will record as Author:
 
-  '"$user_name <$user_email>"'
+  '"$ident"'
 ' &&
 		read -ep 'Is the author name and email address above correct? [Y/n] ' correct &&
 		if test "$correct" != "n" -a "$correct" != "N"; then