diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-04-30 14:49:42 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-04-30 14:49:42 -0700 |
| commit | 07fc8275e1b41c8e256edb0e42483d317adfdb91 (patch) | |
| tree | 6277637c2494f318c008c6c0aa82b547d36631e1 /t | |
| parent | Merge branch 'xx/disable-replace-when-building-midx' (diff) | |
| parent | format-patch: ensure that --rfc and -k are mutually exclusive (diff) | |
| download | git-07fc8275e1b41c8e256edb0e42483d317adfdb91.tar.gz git-07fc8275e1b41c8e256edb0e42483d317adfdb91.zip | |
Merge branch 'ds/format-patch-rfc-and-k'
The "-k" and "--rfc" options of "format-patch" will now error out
when used together, as one tells us not to add anything to the
title of the commit, and the other one tells us to add "RFC" in
addition to "PATCH".
* ds/format-patch-rfc-and-k:
format-patch: ensure that --rfc and -k are mutually exclusive
Diffstat (limited to 't')
| -rwxr-xr-x | t/t4014-format-patch.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index e37a1411ee..90fe6d066c 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -1397,6 +1397,27 @@ test_expect_success '--rfc is argument order independent' ' test_cmp expect actual ' +test_expect_success '--subject-prefix="<non-empty>" and -k cannot be used together' ' + echo "fatal: options '\''--subject-prefix/--rfc'\'' and '\''-k'\'' cannot be used together" >expect.err && + test_must_fail git format-patch -1 --stdout --subject-prefix="MYPREFIX" -k >actual.out 2>actual.err && + test_must_be_empty actual.out && + test_cmp expect.err actual.err +' + +test_expect_success '--subject-prefix="" and -k cannot be used together' ' + echo "fatal: options '\''--subject-prefix/--rfc'\'' and '\''-k'\'' cannot be used together" >expect.err && + test_must_fail git format-patch -1 --stdout --subject-prefix="" -k >actual.out 2>actual.err && + test_must_be_empty actual.out && + test_cmp expect.err actual.err +' + +test_expect_success '--rfc and -k cannot be used together' ' + echo "fatal: options '\''--subject-prefix/--rfc'\'' and '\''-k'\'' cannot be used together" >expect.err && + test_must_fail git format-patch -1 --stdout --rfc -k >actual.out 2>actual.err && + test_must_be_empty actual.out && + test_cmp expect.err actual.err +' + test_expect_success '--from=ident notices bogus ident' ' test_must_fail git format-patch -1 --stdout --from=foo >patch ' |
