From: Felipe Contreras Date: Sun, 15 Apr 2012 19:44:16 +0000 (+0300) Subject: completion: simplify __gitcomp_1 X-Git-Tag: v1.7.11-rc0~104^2~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3bf421ea624fb083ea4d88fd487ae8b7b8bae06a;p=git.git completion: simplify __gitcomp_1 Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 31f714da9..db2d3cc3f 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 }