diff --git a/roles/git/client/templates/git.csh.j2 b/roles/git/client/templates/git.csh.j2 index 4131262..107ce34 100644 --- a/roles/git/client/templates/git.csh.j2 +++ b/roles/git/client/templates/git.csh.j2 @@ -1,6 +1,8 @@ -if ( "`git config user.name`" == "" ) then - git config --global user.name "`getent passwd '${USER}' | cut -d : -f 5`" -endif -if ( "`git config user.email`" == "" ) then - git config --global user.email "${USER}@{{ mail_domain }}" +if ($uid > 3000 && "`/usr/bin/id -gn`" == "`/usr/bin/id -un`") then + if ( "`git config user.name`" == "" ) then + git config --global user.name "`getent passwd '${USER}' | cut -d : -f 5`" + endif + if ( "`git config user.email`" == "" ) then + git config --global user.email "${USER}@{{ mail_domain }}" + endif endif diff --git a/roles/git/client/templates/git.sh.j2 b/roles/git/client/templates/git.sh.j2 index d696124..6367672 100644 --- a/roles/git/client/templates/git.sh.j2 +++ b/roles/git/client/templates/git.sh.j2 @@ -1,6 +1,8 @@ -if [ -z "$(git config user.name)" ]; then - git config --global user.name "$(getent passwd "$USER" | cut -d : -f 5)" -fi -if [ -z "$(git config user.email)" ]; then - git config --global user.email "${USER}@{{ mail_domain }}" +if [ $UID -gt 3000 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then + if [ -z "$(git config user.name)" ]; then + git config --global user.name "$(getent passwd "$USER" | cut -d : -f 5)" + fi + if [ -z "$(git config user.email)" ]; then + git config --global user.email "${USER}@{{ mail_domain }}" + fi fi