diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-09-07 15:06:08 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-09-07 15:06:08 -0700 |
| commit | 09684a12b05b6c01c638cb14e3d765a93d154e32 (patch) | |
| tree | 6d226fa91e783da2a2bb87dbfcbdc2ccb1aff71c /t | |
| parent | 32de857fb200ca48ae3762e56a1e58370037f0a4 (diff) | |
| parent | e0d7db7423a91673c001aaa5e580c815ce2f7f92 (diff) | |
| download | git-09684a12b05b6c01c638cb14e3d765a93d154e32.tar.xz | |
Merge branch 'dd/format-patch-rfc-updates'
"git format-patch --rfc --subject-prefix=<foo>" used to ignore the
"--subject-prefix" option and used "[RFC PATCH]"; now we will add
"RFC" prefix to whatever subject prefix is specified.
This is a backward compatible change that may deserve a note.
* dd/format-patch-rfc-updates:
format-patch: --rfc honors what --subject-prefix sets
Diffstat (limited to 't')
| -rwxr-xr-x | t/t4014-format-patch.sh | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index bc0e29b31a..0a4ab36c3a 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -1373,7 +1373,27 @@ test_expect_success '--rfc' ' Subject: [RFC PATCH 1/1] header with . in it EOF git format-patch -n -1 --stdout --rfc >patch && - grep ^Subject: patch >actual && + grep "^Subject:" patch >actual && + test_cmp expect actual +' + +test_expect_success '--rfc does not overwrite prefix' ' + cat >expect <<-\EOF && + Subject: [RFC PATCH foobar 1/1] header with . in it + EOF + git -c format.subjectPrefix="PATCH foobar" \ + format-patch -n -1 --stdout --rfc >patch && + grep "^Subject:" patch >actual && + test_cmp expect actual +' + +test_expect_success '--rfc is argument order independent' ' + cat >expect <<-\EOF && + Subject: [RFC PATCH foobar 1/1] header with . in it + EOF + git format-patch -n -1 --stdout --rfc \ + --subject-prefix="PATCH foobar" >patch && + grep "^Subject:" patch >actual && test_cmp expect actual ' |
