Skip to content

Commit 4ab5dde

Browse files
committed
Quote path names
This is relevant if the homedir of a user or SYSGIT_PATH_OFFSET contain spaces.
1 parent e75d94c commit 4ab5dde

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bin/sys

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ if [ -n "$SUDO_USER" ]; then
5757
# check for user credentials!
5858
if [ -z "$GIT_COMMITTER_NAME" ]; then
5959
# if they do not exist, try to read from gitconfig in home dir
60-
export GIT_COMMITTER_NAME=$(git config -f $git_config_file user.name)
61-
export GIT_AUTHOR_NAME=$(git config -f $git_config_file user.name)
62-
export GIT_COMMITTER_EMAIL=$(git config -f $git_config_file user.email)
63-
export GIT_AUTHOR_EMAIL=$(git config -f $git_config_file user.email)
60+
export GIT_COMMITTER_NAME=$(git config -f "$git_config_file" user.name)
61+
export GIT_AUTHOR_NAME=$(git config -f "$git_config_file" user.name)
62+
export GIT_COMMITTER_EMAIL=$(git config -f "$git_config_file" user.email)
63+
export GIT_AUTHOR_EMAIL=$(git config -f "$git_config_file" user.email)
6464
# if this fails ... generate the credentials
6565
fi
6666
: ${GIT_COMMITTER_EMAIL:=${SUDO_USER}@${hostname}}
@@ -69,7 +69,7 @@ if [ -n "$SUDO_USER" ]; then
6969
: ${GIT_AUTHOR_NAME:=${SUDO_USER}}
7070
fi
7171
################################################################################
72-
export GIT_DIR=$SYSGIT_PATH_OFFSET/var/lib/sysgit
72+
export GIT_DIR="$SYSGIT_PATH_OFFSET/var/lib/sysgit"
7373
test -e /var/lib/sysgit/ssh && export GIT_SSH=/var/lib/sysgit/ssh
7474

7575
"$@"

0 commit comments

Comments
 (0)