]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fixed an argument counting bug
authorEvan Hunt <each@isc.org>
Wed, 11 Jul 2018 04:00:48 +0000 (21:00 -0700)
committerEvan Hunt <each@isc.org>
Wed, 11 Jul 2018 04:01:00 +0000 (21:01 -0700)
util/git-replay-merge.sh

index 2371c5f973d136f640f39e3e5850af583f57df33..964c5a16037d2d9002912ce1b608ee93a85c1347 100755 (executable)
@@ -94,10 +94,6 @@ branch_exists() {
 }
 
 go() {
-       if [[ $# -ne 3 ]]; then
-               die_with_usage
-       fi
-       die_if_in_progress
        # Process parameters.
        SOURCE_COMMIT="$1"
        TARGET_REMOTE="$2"
@@ -194,8 +190,14 @@ cleanup() {
 }
 
 next_action="go"
-while [[ $# -gt 3 ]]; do
+while [[ $# -ge 1 ]]; do
        case "$1" in
+               "--no-push")
+                       DONT_PUSH=true
+                       ;;
+               "--push")
+                       DONT_PUSH=false
+                       ;;
                "--abort")
                        die_if_not_in_progress
                        source "${STATE_FILE}"
@@ -207,11 +209,11 @@ while [[ $# -gt 3 ]]; do
                        source "${STATE_FILE}"
                        next_action="resume"
                        ;;
-               "--no-push")
-                       DONT_PUSH=true
-                       ;;
-               "--push")
-                       DONT_PUSH=false
+               *)
+                       if [[ $# -ne 3 ]]; then
+                               die_with_usage
+                       fi
+                       break
                        ;;
        esac
        shift