bisect: trap critical errors in "bisect_start"
commitba963de859e76a63d447345eeb3e134116d02433
authorChristian Couder <chriscool@tuxfamily.org>
Thu, 22 May 2008 22:39:22 +0000 (23 00:39 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 23 May 2008 05:24:16 +0000 (22 22:24 -0700)
tree29b0a9aec6aa7320c1b024f333419695c8ab31e9
parent9d0cd91c4e497192e89177847d1511acea5793cd
bisect: trap critical errors in "bisect_start"

Before this patch, when using "git bisect start" with mistaken revs
or when the checkout of the branch we want to test failed, we exited
after having written files like ".git/BISECT_START",
".git/BISECT_NAMES" and after having written "refs/bisect/bad" and
"refs/bisect/good-*" refs.

With this patch we trap all errors that can happen when writing the
new state and when we are in "bisect_next". So that we can try to
clean up everything in case of problems, using "bisect_clean_state".

This patch also contains a "bisect_write" cleanup to make it exit
on error and return 0 otherwise.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-bisect.sh
t/t6030-bisect-porcelain.sh