Skip to content

Commit 693f62f

Browse files
committed
Merge branch 'js/completion-hide-not-a-repo'
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
2 parents 48f662d + 8f7ff5b commit 693f62f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/completion/git-completion.bash

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,8 @@ __git_refs ()
384384
;;
385385
*)
386386
echo "HEAD"
387-
git for-each-ref --format="%(refname:short)" -- "refs/remotes/$dir/" | sed -e "s#^$dir/##"
387+
git for-each-ref --format="%(refname:short)" -- \
388+
"refs/remotes/$dir/" 2>/dev/null | sed -e "s#^$dir/##"
388389
;;
389390
esac
390391
}

0 commit comments

Comments
 (0)