Skip to content

Commit

Permalink
fix(git aliases): one alias per array element
Browse files Browse the repository at this point in the history
  • Loading branch information
olets committed Apr 7, 2020
1 parent 4603f5d commit 72b0bd7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions zsh-abbr.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,16 @@ _zsh_abbr() {
(( ZSH_ABBR_DEBUG )) && echo "_zsh_abbr:import_git_aliases"

local git_aliases
local abbr_git_aliases

if [[ $# > 0 ]]; then
_zsh_abbr:util_error " import-git-aliases: Unexpected argument"
return
fi

git_aliases=(${(@f)$(git config --get-regexp '^alias\.')})
typeset -A abbr_git_aliases
typeset -a git_aliases
while read -r line; do
git_aliases+=($line)
done < <(git config --get-regexp '^alias\.')

for git_alias in $git_aliases; do
key=${$(echo - $git_alias | awk '{print $1;}')##alias.}
Expand Down

0 comments on commit 72b0bd7

Please sign in to comment.