Skip to content

Commit

Permalink
bisect: fix exiting when checkout failed in bisect_start()
Browse files Browse the repository at this point in the history
Commit 4796e82 ("bisect: introduce --no-checkout support into porcelain." Aug 4 2011)
made checking out the branch where we started depends on the "checkout" mode. But
unfortunately it lost the "|| exit" part after the checkout command.

As it makes no sense to continue if the checkout failed and as people have already
complained that the error message given when we just exit in this case is not clear, see:

http://thread.gmane.org/gmane.comp.version-control.git/180733/

this patch adds a "|| die <hopefully clear message>" part after the checkout command.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Acked-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Sep 21, 2011
1 parent 24c5128 commit 1acf117
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-bisect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ bisect_start() {
start_head=$(cat "$GIT_DIR/BISECT_START")
if test "z$mode" != "z--no-checkout"
then
git checkout "$start_head" --
git checkout "$start_head" -- ||
die "$(eval_gettext "Checking out '\$start_head' failed. Try 'git bisect reset <validbranch>'.")"
fi
else
# Get rev from where we start.
Expand Down

0 comments on commit 1acf117

Please sign in to comment.