Sync with 1.7.7.2
[gitweb.git] / contrib / completion / git-completion.bash
index fc3d0b1a0678ddf99c592959d2fe58c59543ec40..98af8f5c7ee68876e94194524cc0cda9d3f25345 100755 (executable)
@@ -1430,6 +1430,10 @@ _git_gitk ()
        _gitk
 }
 
+__git_match_ctag() {
+       awk "/^${1////\\/}/ { print \$1 }" "$2"
+}
+
 _git_grep ()
 {
        __git_has_doubledash && return
@@ -1452,6 +1456,15 @@ _git_grep ()
                ;;
        esac
 
+       case "$cword,$prev" in
+       2,*|*,-*)
+               if test -r tags; then
+                       __gitcomp "$(__git_match_ctag "$cur" tags)"
+                       return
+               fi
+               ;;
+       esac
+
        __gitcomp "$(__git_refs)"
 }