diff options
Diffstat (limited to 'contrib/completion/git-completion.bash')
-rw-r--r-- | contrib/completion/git-completion.bash | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index d45d082846..f38579214f 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -53,19 +53,6 @@ __gitdir () fi } -__gitcomp_1 () -{ - local c IFS=$' \t\n' - for c in $1; do - c="$c$2" - case $c in - --*=*|*.) ;; - *) c="$c " ;; - esac - printf '%s\n' "$c" - done -} - # The following function is based on code from: # # bash_completion - programmable completion functions for bash 3.2+ @@ -220,8 +207,17 @@ __gitcomp () --*=) ;; *) - local IFS=$'\n' - __gitcompadd "$(__gitcomp_1 "${1-}" "${4-}")" "${2-}" "$cur_" "" + local c i=0 IFS=$' \t\n' + for c in $1; do + c="$c${4-}" + case $c in + --*=*|*.) ;; + *) c="$c " ;; + esac + if [[ $c == "$cur_"* ]]; then + COMPREPLY[i++]="${2-}$c" + fi + done ;; esac } |