Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit c37849f

Browse files
committed
Support newlines in git aliases that are not shell commands
The newlines are changed to spaces in the alias to avoid the execution of several shell commands just as git (2.11) does.
1 parent 28392e2 commit c37849f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

git-sh.bash

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ _git_import_aliases () {
170170
command=$(git config --get "alias.$key")
171171
if expr -- "$command" : '!' >/dev/null
172172
then echo "alias $key='git $key'"
173-
else echo "gitalias $key=\"git $command\""
173+
else echo "gitalias $key=\"git $(set -f; printf '%s ' $command)\""
174+
# Newlines in aliases that are not shell commands will be
175+
# considered whitespace (as git itself would do).
174176
fi
175177
done
176178
)"

0 commit comments

Comments
 (0)