Treat BISECT_HEAD as a pseudo ref

Both the git-bisect.sh as bisect--helper inspected the file system directly.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Han-Wen Nienhuys
2020-06-16 19:20:30 +00:00
committed by Junio C Hamano
parent 8794bb5159
commit c69b75b7d9
2 changed files with 3 additions and 4 deletions

View File

@ -41,7 +41,7 @@ TERM_GOOD=good
bisect_head()
{
if test -f "$GIT_DIR/BISECT_HEAD"
if git rev-parse --verify -q BISECT_HEAD > /dev/null
then
echo BISECT_HEAD
else
@ -153,7 +153,7 @@ bisect_next() {
git bisect--helper --bisect-next-check $TERM_GOOD $TERM_BAD $TERM_GOOD|| exit
# Perform all bisection computation, display and checkout
git bisect--helper --next-all $(test -f "$GIT_DIR/BISECT_HEAD" && echo --no-checkout)
git bisect--helper --next-all $(git rev-parse --verify -q BISECT_HEAD > /dev/null && echo --no-checkout)
res=$?
# Check if we should exit because bisection is finished