summaryrefslogtreecommitdiff
path: root/t/t3406-rebase-message.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-11-14 16:25:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-16 02:52:13 (GMT)
commit04519d72011478e17b2dbb177820ef2c886b8e5f (patch)
treee93d9866e52086e05489d8c20b40d089a690304b /t/t3406-rebase-message.sh
parentf57696802c300494562f4287e88f07540b3dbd4a (diff)
downloadgit-04519d72011478e17b2dbb177820ef2c886b8e5f.zip
git-04519d72011478e17b2dbb177820ef2c886b8e5f.tar.gz
git-04519d72011478e17b2dbb177820ef2c886b8e5f.tar.bz2
rebase: validate -C<n> and --whitespace=<mode> parameters early
It is a good idea to error out early upon seeing, say, `-Cbad`, rather than starting the rebase only to have the `--am` backend complain later. Let's do this. The only options accepting parameters which we pass through to `git am` (which may, or may not, forward them to `git apply`) are `-C` and `--whitespace`. The other options we pass through do not accept parameters, so we do not have to validate them here. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3406-rebase-message.sh')
-rwxr-xr-xt/t3406-rebase-message.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh
index 0392e36..2c79eed 100755
--- a/t/t3406-rebase-message.sh
+++ b/t/t3406-rebase-message.sh
@@ -84,4 +84,11 @@ test_expect_success 'rebase --onto outputs the invalid ref' '
test_i18ngrep "invalid-ref" err
'
+test_expect_success 'error out early upon -C<n> or --whitespace=<bad>' '
+ test_must_fail git rebase -Cnot-a-number HEAD 2>err &&
+ test_i18ngrep "numerical value" err &&
+ test_must_fail git rebase --whitespace=bad HEAD 2>err &&
+ test_i18ngrep "Invalid whitespace option" err
+'
+
test_done