Skip to content

Commit 48949a1

Browse files
chriscoolgitster
authored andcommitted
bisect: squelch "fatal: ref HEAD not a symref" misleading message
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1da1643 commit 48949a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-bisect.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ bisect_start() {
6262
# Verify HEAD. If we were bisecting before this, reset to the
6363
# top-of-line master first!
6464
#
65-
head=$(GIT_DIR="$GIT_DIR" git symbolic-ref HEAD) ||
65+
head=$(GIT_DIR="$GIT_DIR" git symbolic-ref -q HEAD) ||
6666
head=$(GIT_DIR="$GIT_DIR" git rev-parse --verify HEAD) ||
6767
die "Bad HEAD - I need a HEAD"
6868
case "$head" in

0 commit comments

Comments
 (0)