Skip to content

Commit 43b8ff4

Browse files
committed
bisect: further style nitpicks
Fix a few remaining lines that indented with spaces. Also simplify the logic of checking out the original branch and reporting error during "bisect reset". Signed-off-by: Junio C Hamano <[email protected]>
1 parent eef12a9 commit 43b8ff4

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

git-bisect.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ bisect_start() {
9494
die "$(eval_gettext "unrecognised option: '\$arg'")" ;;
9595
*)
9696
rev=$(git rev-parse -q --verify "$arg^{commit}") || {
97-
test $has_double_dash -eq 1 &&
98-
die "$(eval_gettext "'\$arg' does not appear to be a valid revision")"
99-
break
97+
test $has_double_dash -eq 1 &&
98+
die "$(eval_gettext "'\$arg' does not appear to be a valid revision")"
99+
break
100100
}
101101
case $bad_seen in
102102
0) state='bad' ; bad_seen=1 ;;
@@ -125,7 +125,7 @@ bisect_start() {
125125
start_head=$(cat "$GIT_DIR/BISECT_START")
126126
if test "z$mode" != "z--no-checkout"
127127
then
128-
git checkout "$start_head" --
128+
git checkout "$start_head" --
129129
fi
130130
else
131131
# Get rev from where we start.
@@ -332,7 +332,7 @@ bisect_visualize() {
332332
if test $# = 0
333333
then
334334
if test -n "${DISPLAY+set}${SESSIONNAME+set}${MSYSTEM+set}${SECURITYSESSIONID+set}" &&
335-
type gitk >/dev/null 2>&1
335+
type gitk >/dev/null 2>&1
336336
then
337337
set gitk
338338
else
@@ -364,13 +364,11 @@ bisect_reset() {
364364
*)
365365
usage ;;
366366
esac
367-
if ! test -f "$GIT_DIR/BISECT_HEAD"
367+
368+
if ! test -f "$GIT_DIR/BISECT_HEAD" && ! git checkout "$branch" --
368369
then
369-
if ! git checkout "$branch" --
370-
then
371-
die "$(eval_gettext "Could not check out original HEAD '\$branch'.
370+
die "$(eval_gettext "Could not check out original HEAD '\$branch'.
372371
Try 'git bisect reset <commit>'.")"
373-
fi
374372
fi
375373
bisect_clean_state
376374
}

0 commit comments

Comments
 (0)