Skip to content

Commit

Permalink
Merge branch 'js/completion-hide-not-a-repo'
Browse files Browse the repository at this point in the history
Some internal error messages leaked out of the bash completion when
typing "git cmd <TAB>" and the machinery tried to complete
refnames.

* js/completion-hide-not-a-repo:
  completion: silence "fatal: Not a git repository" error
  • Loading branch information
Junio C Hamano committed Oct 21, 2014
2 parents 48f662d + 8f7ff5b commit 693f62f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ __git_refs ()
;;
*)
echo "HEAD"
git for-each-ref --format="%(refname:short)" -- "refs/remotes/$dir/" | sed -e "s#^$dir/##"
git for-each-ref --format="%(refname:short)" -- \
"refs/remotes/$dir/" 2>/dev/null | sed -e "s#^$dir/##"
;;
esac
}
Expand Down

0 comments on commit 693f62f

Please sign in to comment.