diff options
Diffstat (limited to 'contrib/completion/git-completion.bash')
-rwxr-xr-x | contrib/completion/git-completion.bash | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index f258f2f03e..e4a32b61b2 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -222,11 +222,16 @@ _git_ls_tree () _git_log () { - local cur="${COMP_WORDS[COMP_CWORD]}" + local pfx cur="${COMP_WORDS[COMP_CWORD]}" case "$cur" in + *...*) + pfx="${cur%...*}..." + cur="${cur#*...}" + COMPREPLY=($(compgen -P "$pfx" -W "$(__git_refs)" -- "$cur")) + ;; *..*) - local pfx=$(echo "$cur" | sed 's/\.\..*$/../') - cur=$(echo "$cur" | sed 's/^.*\.\.//') + pfx="${cur%..*}.." + cur="${cur#*..}" COMPREPLY=($(compgen -P "$pfx" -W "$(__git_refs)" -- "$cur")) ;; *) |