Skip to content

Commit 6f01e6b

Browse files
chriscoolJunio C Hamano
authored andcommitted
Bisect: Improve error message in "bisect_next_check".
So we can remove the specific message in "bisect_run". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 18acb3e commit 6f01e6b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

git-bisect.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,15 @@ bisect_next_check() {
123123
case "$next_ok,$1" in
124124
no,) false ;;
125125
no,fail)
126-
echo >&2 'You need to give me at least one good and one bad revisions.'
126+
THEN=''
127+
test -d "$GIT_DIR/refs/bisect" || {
128+
echo >&2 'You need to start by "git bisect start".'
129+
THEN='then '
130+
}
131+
echo >&2 'You '$THEN'need to give me at least one good' \
132+
'and one bad revisions.'
133+
echo >&2 '(You can use "git bisect bad" and' \
134+
'"git bisect good" for that.)'
127135
exit 1 ;;
128136
*)
129137
true ;;
@@ -223,12 +231,6 @@ bisect_replay () {
223231
}
224232

225233
bisect_run () {
226-
# Check that we have everything to run correctly.
227-
test -d "$GIT_DIR/refs/bisect" || {
228-
echo >&2 'You need to start by "git bisect start".'
229-
echo >&2 'And then by "git bisect bad" and "git bisect good".'
230-
exit 1
231-
}
232234
bisect_next_check fail
233235

234236
while true

0 commit comments

Comments
 (0)