bisect: don't mix option parsing and non-trivial code
[gitweb.git] / git-bisect.sh
index dcd7e5900eea4180a2f23d69227f771e5e387f02..ea63223ab3b5d4f8fb0a9af45db4278aef010fb7 100755 (executable)
@@ -78,6 +78,7 @@ bisect_start() {
        bad_seen=0
        eval=''
        must_write_terms=0
+       revs=''
        if test "z$(git rev-parse --is-bare-repository)" != zfalse
        then
                mode=--no-checkout
@@ -102,24 +103,27 @@ bisect_start() {
                                die "$(eval_gettext "'\$arg' does not appear to be a valid revision")"
                                break
                        }
-
-                       # The user ran "git bisect start <sha1>
-                       # <sha1>", hence did not explicitly specify
-                       # the terms, but we are already starting to
-                       # set references named with the default terms,
-                       # and won't be able to change afterwards.
-                       must_write_terms=1
-
-                       case $bad_seen in
-                       0) state=$TERM_BAD ; bad_seen=1 ;;
-                       *) state=$TERM_GOOD ;;
-                       esac
-                       eval="$eval bisect_write '$state' '$rev' 'nolog' &&"
+                       revs="$revs $rev"
                        shift
                        ;;
                esac
        done
 
+       for rev in $revs
+       do
+               # The user ran "git bisect start <sha1>
+               # <sha1>", hence did not explicitly specify
+               # the terms, but we are already starting to
+               # set references named with the default terms,
+               # and won't be able to change afterwards.
+               must_write_terms=1
+
+               case $bad_seen in
+               0) state=$TERM_BAD ; bad_seen=1 ;;
+               *) state=$TERM_GOOD ;;
+               esac
+               eval="$eval bisect_write '$state' '$rev' 'nolog' &&"
+       done
        #
        # Verify HEAD.
        #