git: Lower UID limit for configuring git

This commit is contained in:
Timo Makinen 2024-06-16 21:53:10 +03:00
parent 2c232f1654
commit efee5effcc
2 changed files with 2 additions and 2 deletions

View file

@ -1,4 +1,4 @@
if ($uid > 3000 && "`/usr/bin/id -gn`" == "`/usr/bin/id -un`") then if ($uid > 999 && "`/usr/bin/id -gn`" == "`/usr/bin/id -un`") then
if ( "`git config user.name`" == "" ) then if ( "`git config user.name`" == "" ) then
git config --global user.name "`getent passwd '${USER}' | cut -d : -f 5`" git config --global user.name "`getent passwd '${USER}' | cut -d : -f 5`"
endif endif

View file

@ -1,4 +1,4 @@
if [ $UID -gt 3000 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then if [ $UID -gt 999 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then
if [ -z "$(git config user.name)" ]; then if [ -z "$(git config user.name)" ]; then
git config --global user.name "$(getent passwd "$USER" | cut -d : -f 5)" git config --global user.name "$(getent passwd "$USER" | cut -d : -f 5)"
fi fi