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 <gitster@pobox.com>
Junio C Hamano committed
Aug 5, 2011 at 10:09 UTC
43b8ff4b149bb3e17271608380b4a73c2e290b77
1 file changed
+8
-10
git-bisect.sh
+8
-10
@@ -94,9 +94,9 @@ bisect_start() {
94
die "$(eval_gettext "unrecognised option: '\$arg'")" ;;
95
*)
96
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
100
}
101
case $bad_seen in
102
0) state='bad' ; bad_seen=1 ;;
@@ -125,7 +125,7 @@ bisect_start() {
125
start_head=$(cat "$GIT_DIR/BISECT_START")
126
if test "z$mode" != "z--no-checkout"
127
then
128
- git checkout "$start_head" --
128
+ git checkout "$start_head" --
129
fi
130
else
131
# Get rev from where we start.
@@ -332,7 +332,7 @@ bisect_visualize() {
332
if test $# = 0
333
then
334
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
336
then
337
set gitk
338
else
@@ -364,13 +364,11 @@ bisect_reset() {
364
*)
365
usage ;;
366
esac
367
- if ! test -f "$GIT_DIR/BISECT_HEAD"
367
+
368
+ if ! test -f "$GIT_DIR/BISECT_HEAD" && ! git checkout "$branch" --
369
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'.
371
Try 'git bisect reset <commit>'.")"
373
- fi
372
fi
373
bisect_clean_state
374
}