Skip to content

Commit 7e097e2

Browse files
dschogitster
authored andcommitted
legacy-rebase: backport -C<n> and --whitespace=<option> checks
Since 04519d7 (rebase: validate -C<n> and --whitespace=<mode> parameters early, 2018-11-14), the built-in rebase validates the -C and --whitespace arguments early. As this commit also introduced a regression test for this, and as a later commit introduced the GIT_TEST_REBASE_USE_BUILTIN mode to run tests, we now have a "regression" in the scripted version of `git rebase` on our hands. Backport the validation to fix this. Reported-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 04519d7 commit 7e097e2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

git-legacy-rebase.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ do
337337
fix|strip)
338338
force_rebase=t
339339
;;
340+
warn|nowarn|error|error-all)
341+
;; # okay, known whitespace option
342+
*)
343+
die "fatal: Invalid whitespace option: '${1#*=}'"
344+
;;
340345
esac
341346
;;
342347
--ignore-whitespace)
@@ -352,6 +357,9 @@ do
352357
git_am_opt="$git_am_opt $1"
353358
force_rebase=t
354359
;;
360+
-C*[!0-9]*)
361+
die "fatal: switch \`C' expects a numerical value"
362+
;;
355363
-C*)
356364
git_am_opt="$git_am_opt $1"
357365
;;

0 commit comments

Comments
 (0)