Skip to content

Commit 1acf117

Browse files
chriscoolgitster
authored andcommitted
bisect: fix exiting when checkout failed in bisect_start()
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 <[email protected]> Acked-by: Jon Seymour <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 24c5128 commit 1acf117

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git-bisect.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ bisect_start() {
129129
start_head=$(cat "$GIT_DIR/BISECT_START")
130130
if test "z$mode" != "z--no-checkout"
131131
then
132-
git checkout "$start_head" --
132+
git checkout "$start_head" -- ||
133+
die "$(eval_gettext "Checking out '\$start_head' failed. Try 'git bisect reset <validbranch>'.")"
133134
fi
134135
else
135136
# Get rev from where we start.

0 commit comments

Comments
 (0)