Merge branch 'fc/simplify-complete-revlist-file'
[gitweb.git] / contrib / completion / git-completion.bash
index 9f56ec7a6bde4b195b6e960e38e5403ce0b001b0..2f60825b21e33d8a00d1763d9bcad4dc6e6a60a7 100755 (executable)
@@ -676,9 +676,7 @@ __git_complete_revlist_file ()
                *)   pfx="$ref:$pfx" ;;
                esac
 
-               local IFS=$'\n'
-               COMPREPLY=($(compgen -P "$pfx" \
-                       -W "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
+               __gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
                                | sed '/^100... blob /{
                                           s,^.*        ,,
                                           s,$, ,
@@ -692,7 +690,7 @@ __git_complete_revlist_file ()
                                           s,$,/,
                                       }
                                       s/^.*    //')" \
-                       -- "$cur_"))
+                       "$pfx" "$cur_" ""
                ;;
        *...*)
                pfx="${cur_%...*}..."