diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2012-04-15 22:44:16 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-21 22:39:06 -0700 |
commit | 3bf421ea624fb083ea4d88fd487ae8b7b8bae06a (patch) | |
tree | 1e327eb3a21479a27267b36244af15f470dc6146 /contrib | |
parent | 74a8c849f1257dde0c42feac95ba517bae625647 (diff) | |
download | git-3bf421ea624fb083ea4d88fd487ae8b7b8bae06a.tar.gz |
completion: simplify __gitcomp_1
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/completion/git-completion.bash | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 31f714da92..db2d3cc3fd 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -304,16 +304,16 @@ __git_ps1 () fi } -# __gitcomp_1 requires 2 arguments __gitcomp_1 () { - local c IFS=' '$'\t'$'\n' + local c IFS=$' \t\n' for c in $1; do - case "$c$2" in - --*=*) printf %s$'\n' "$c$2" ;; - *.) printf %s$'\n' "$c$2" ;; - *) printf %s$'\n' "$c$2 " ;; + c="$c$2" + case $c in + --*=*|*.) ;; + *) c="$c " ;; esac + printf '%s\n' "$c" done } |