Skip to content

Commit

Permalink
bisect: squelch "fatal: ref HEAD not a symref" misleading message
Browse files Browse the repository at this point in the history
To get the current HEAD when we start bisecting using for example
"git bisect start", we first try "git symbolic-ref HEAD" to get a
nice name, and if it fails, we fall back to "git rev-parse
--verify HEAD".

The problem is that when "git symbolic-ref HEAD" fails, it
displays "fatal: ref HEAD not a symref", so it looks like "git
bisect start" failed and does not accept detached HEAD, even if
in fact it worked fine.

This patch adds "-q" option to the "git symbolic-ref" call to
get rid of the misleading error message.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Apr 16, 2008
1 parent 1da1643 commit 48949a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-bisect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ bisect_start() {
# Verify HEAD. If we were bisecting before this, reset to the
# top-of-line master first!
#
head=$(GIT_DIR="$GIT_DIR" git symbolic-ref HEAD) ||
head=$(GIT_DIR="$GIT_DIR" git symbolic-ref -q HEAD) ||
head=$(GIT_DIR="$GIT_DIR" git rev-parse --verify HEAD) ||
die "Bad HEAD - I need a HEAD"
case "$head" in
Expand Down

0 comments on commit 48949a1

Please sign in to comment.