Merge branch 'ds/completion-silence-in-tree-path-probe'
authorJunio C Hamano <gitster@pobox.com>
Fri, 18 Jan 2013 19:20:03 +0000 (11:20 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 18 Jan 2013 19:20:03 +0000 (11:20 -0800)
An internal ls-tree call made by completion code only to probe if
a path exists in the tree recorded in a commit object leaked error
messages when the path is not there. It is not an error at all and
should not be shown to the end user.

* ds/completion-silence-in-tree-path-probe:
git-completion.bash: silence "not a valid object" errors

contrib/completion/git-completion.bash
index a4c48e179eb778077462a812b491e762e284486c..14dd5e7ca272350b3fa13d6fc8da3ccb46e12227 100644 (file)
@@ -397,7 +397,7 @@ __git_complete_revlist_file ()
                *)   pfx="$ref:$pfx" ;;
                esac
 
-               __gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
+               __gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" 2>/dev/null \
                                | sed '/^100... blob /{
                                           s,^.*        ,,
                                           s,$, ,