From: Christian Couder Date: Wed, 16 Apr 2008 02:09:49 +0000 (+0200) Subject: bisect: squelch "fatal: ref HEAD not a symref" misleading message X-Git-Tag: v1.5.5.1~7^2~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=48949a18c852e5119827278c37f791921e640688;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/git-bisect.sh b/git-bisect.sh index c99ffee12..dd91bd5bc 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -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