function git_user {
if ! grep -q "^\[user\]" $GIT_FOLDER/.git/config; then
if echo $ARGS | grep -q -- '--config'; then
- grep -A 2 "^\[user\]" $HOME/.gitconfig >> $GIT_FOLDER/.git/config
+ if grep -q "^\[user\]" $HOME/.gitconfig; then
+ grep -A 2 "^\[user\]" $HOME/.gitconfig >> $GIT_FOLDER/.git/config
+ else
+ grep -A 2 "^\[user\]" $HOME/.custom/gitconfig >> $GIT_FOLDER/.git/config
+ fi
else
echo "No user configuration section found in the repository."