From: Dylan Smith Date: Fri, 11 Jan 2013 08:06:22 +0000 (-0500) Subject: git-completion.bash: silence "not a valid object" errors X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ca87dd623d24590c4d48a922effa1d9e1e1fd253;p=git.git git-completion.bash: silence "not a valid object" errors Trying to complete the command git show master:./file would cause a "Not a valid object name" error to be output on standard error. Silence the error so it won't appear on the command line. Signed-off-by: Dylan Smith Reviewed-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 2e1b5e14b..6312e3d8e 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -676,7 +676,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,$, ,