@matheusbsbs / matheus-bagliano / commits / 5a1d31c7e4
Fork 0

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>

Christian Couder committed Apr 19, 2009 at 11:56 UTC 5a1d31c7e43a54c3a5275266745488de7208d871
1 file changed +9 -30
git-bisect.sh
+9 -30
@@ -279,19 +279,6 @@ bisect_auto_next() {
279 bisect_next_check && bisect_next || :
280 }
281
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 -
282 bisect_checkout() {
283 _rev="$1"
284 _msg="$2"
@@ -416,25 +403,17 @@ bisect_next() {
403 # Return now if a checkout has already been done
404 test "$?" -eq "1" && return
405
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=$?
409
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
412
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
417 }
418
419 bisect_visualize() {