summaryrefslogtreecommitdiff
path: root/git-bisect.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-05 17:09:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-05 17:13:21 (GMT)
commit43b8ff4b149bb3e17271608380b4a73c2e290b77 (patch)
tree11e3c8bdfab737e0019307a8be9f2f459a9ab0ee /git-bisect.sh
parenteef12a9a7782bfe12f1ef870aa73143622be2ac1 (diff)
downloadgit-43b8ff4b149bb3e17271608380b4a73c2e290b77.zip
git-43b8ff4b149bb3e17271608380b4a73c2e290b77.tar.gz
git-43b8ff4b149bb3e17271608380b4a73c2e290b77.tar.bz2
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>
Diffstat (limited to 'git-bisect.sh')
-rwxr-xr-xgit-bisect.sh18
1 files changed, 8 insertions, 10 deletions
diff --git a/git-bisect.sh b/git-bisect.sh
index 1f3c46d..22c4da5 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -94,9 +94,9 @@ bisect_start() {
die "$(eval_gettext "unrecognised option: '\$arg'")" ;;
*)
rev=$(git rev-parse -q --verify "$arg^{commit}") || {
- test $has_double_dash -eq 1 &&
- die "$(eval_gettext "'\$arg' does not appear to be a valid revision")"
- break
+ test $has_double_dash -eq 1 &&
+ die "$(eval_gettext "'\$arg' does not appear to be a valid revision")"
+ break
}
case $bad_seen in
0) state='bad' ; bad_seen=1 ;;
@@ -125,7 +125,7 @@ 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" --
fi
else
# Get rev from where we start.
@@ -332,7 +332,7 @@ bisect_visualize() {
if test $# = 0
then
if test -n "${DISPLAY+set}${SESSIONNAME+set}${MSYSTEM+set}${SECURITYSESSIONID+set}" &&
- type gitk >/dev/null 2>&1
+ type gitk >/dev/null 2>&1
then
set gitk
else
@@ -364,13 +364,11 @@ bisect_reset() {
*)
usage ;;
esac
- if ! test -f "$GIT_DIR/BISECT_HEAD"
+
+ if ! test -f "$GIT_DIR/BISECT_HEAD" && ! git checkout "$branch" --
then
- if ! git checkout "$branch" --
- then
- die "$(eval_gettext "Could not check out original HEAD '\$branch'.
+ die "$(eval_gettext "Could not check out original HEAD '\$branch'.
Try 'git bisect reset <commit>'.")"
- fi
fi
bisect_clean_state
}