Merge branch 'js/rebase-am-options-fix'
authorJunio C Hamano <gitster@pobox.com>
Wed, 21 Nov 2018 11:39:01 +0000 (20:39 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 21 Nov 2018 11:39:01 +0000 (20:39 +0900)
Recently, built-in "rebase" tightened the error checking for a few
options that are passed to underlying "am", but we forgot to make
the matching change to the scripted version, which has been
corrected.

* js/rebase-am-options-fix:
legacy-rebase: backport -C<n> and --whitespace=<option> checks

git-legacy-rebase.sh
index 75a08b2683e76e6832475bc91e4d4f38b3d3bc3c..b97ffdc9dd550d8802039d672623f2ba3e7a5f0c 100755 (executable)
@@ -337,6 +337,11 @@ do
                fix|strip)
                        force_rebase=t
                        ;;
+               warn|nowarn|error|error-all)
+                       ;; # okay, known whitespace option
+               *)
+                       die "fatal: Invalid whitespace option: '${1#*=}'"
+                       ;;
                esac
                ;;
        --ignore-whitespace)
@@ -352,6 +357,9 @@ do
                git_am_opt="$git_am_opt $1"
                force_rebase=t
                ;;
+       -C*[!0-9]*)
+               die "fatal: switch \`C' expects a numerical value"
+               ;;
        -C*)
                git_am_opt="$git_am_opt $1"
                ;;