Skip to content

Commit 44432b2

Browse files
committed
fix(git aliases): proper quoting
1 parent 72b0bd7 commit 44432b2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

zsh-abbr.zsh

+8-3
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,15 @@ _zsh_abbr() {
261261
done < <(git config --get-regexp '^alias\.')
262262

263263
for git_alias in $git_aliases; do
264-
key=${$(echo - $git_alias | awk '{print $1;}')##alias.}
265-
value=${$(echo - $git_alias)##alias.$key }
264+
key=${${git_alias%% *}#alias.}
265+
value=${git_alias#* }
266266

267-
_zsh_abbr:util_add "g$key" "git ${value# }"
267+
if ! (( ZSH_ABBR_INITIALIZING )); then
268+
abbreviation=${(q)abbreviation}
269+
expansion=${(q)expansion}
270+
fi
271+
272+
_zsh_abbr:util_add "g$key" "git $value"
268273
done
269274

270275
if ! (( dry_run )); then

0 commit comments

Comments
 (0)