]> gitweb.fluxo.info Git - scripts.git/commitdiff
Commit: properly check for user.email and user.name
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 17 Apr 2014 23:13:28 +0000 (20:13 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 17 Apr 2014 23:13:28 +0000 (20:13 -0300)
commit

diff --git a/commit b/commit
index 3a8e5d89ad8149bde5ce0fb7e9bd6e80580f92ec..4be63d271080b6241a63bb0a97364760c4eb9803 100755 (executable)
--- a/commit
+++ b/commit
@@ -88,7 +88,7 @@ function git_push {
 
 # Check user information
 function git_user {
-  if ! grep -q "^\[user\]" $GIT_FOLDER/.git/config; then
+  if [ -z "`git config user.email`" ] && [ -z "`git config user.name`" ]; then
     if echo $ARGS | grep -q -- '--config'; then
       if grep -q "^\[user\]" $HOME/.gitconfig; then
         grep -A 2 "^\[user\]" $HOME/.gitconfig >> $GIT_FOLDER/.git/config