aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcommit6
1 files changed, 5 insertions, 1 deletions
diff --git a/commit b/commit
index d55c8e6..94eba0f 100755
--- a/commit
+++ b/commit
@@ -88,7 +88,11 @@ function git_push {
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."