Skip to content

Commit 5a1d31c

Browse files
chriscoolgitster
authored andcommitted
bisect: use "git bisect--helper --next-exit" in "git-bisect.sh"
instead of "git bisect--helper --next-vars". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent ef24c7c commit 5a1d31c

1 file changed

Lines changed: 9 additions & 30 deletions

File tree

git-bisect.sh

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -279,19 +279,6 @@ bisect_auto_next() {
279279
bisect_next_check && bisect_next || :
280280
}
281281

282-
exit_if_skipped_commits () {
283-
_tried=$1
284-
_bad=$2
285-
if test -n "$_tried" ; then
286-
echo "There are only 'skip'ped commit left to test."
287-
echo "The first bad commit could be any of:"
288-
echo "$_tried" | tr '[|]' '[\012]'
289-
test -n "$_bad" && echo "$_bad"
290-
echo "We cannot bisect more!"
291-
exit 2
292-
fi
293-
}
294-
295282
bisect_checkout() {
296283
_rev="$1"
297284
_msg="$2"
@@ -416,25 +403,17 @@ bisect_next() {
416403
# Return now if a checkout has already been done
417404
test "$?" -eq "1" && return
418405

419-
# Get bisection information
420-
eval=$(eval "git bisect--helper --next-vars") &&
421-
eval "$eval" || exit
406+
# Perform bisection computation, display and checkout
407+
git bisect--helper --next-exit
408+
res=$?
422409

423-
if [ -z "$bisect_rev" ]; then
424-
# We should exit here only if the "bad"
425-
# commit is also a "skip" commit (see above).
426-
exit_if_skipped_commits "$bisect_tried"
427-
echo "$bad was both good and bad"
428-
exit 1
429-
fi
430-
if [ "$bisect_rev" = "$bad" ]; then
431-
exit_if_skipped_commits "$bisect_tried" "$bad"
432-
echo "$bisect_rev is first bad commit"
433-
git diff-tree --pretty $bisect_rev
434-
exit 0
435-
fi
410+
# Check if we should exit because bisection is finished
411+
test $res -eq 10 && exit 0
436412

437-
bisect_checkout "$bisect_rev" "$bisect_nr revisions left to test after this (roughly $bisect_steps steps)"
413+
# Check for an error in the bisection process
414+
test $res -ne 0 && exit $res
415+
416+
return 0
438417
}
439418

440419
bisect_visualize() {

0 commit comments

Comments
 (0)