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:43 -0700 |
| commit | 708e9257f8045e00dca1241ab13c1e8033ead41c (patch) | |
| tree | 1fd05bac88b2593b81fdb6b7f7f3a654a37d589d /t | |
| parent | Merge branch 'ds/format-patch-rfc-and-k' (diff) | |
| parent | format-patch: "--rfc=-(WIP)" appends to produce [PATCH (WIP)] (diff) | |
| download | git-708e9257f8045e00dca1241ab13c1e8033ead41c.tar.gz git-708e9257f8045e00dca1241ab13c1e8033ead41c.zip | |
Merge branch 'jc/format-patch-rfc-more'
The "--rfc" option of "git format-patch" learned to take an
optional string value to be used in place of "RFC" to tweak the
"[PATCH]" on the subject header.
* jc/format-patch-rfc-more:
format-patch: "--rfc=-(WIP)" appends to produce [PATCH (WIP)]
format-patch: allow --rfc to optionally take a value, like --rfc=WIP
Diffstat (limited to 't')
| -rwxr-xr-x | t/t4014-format-patch.sh | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 90fe6d066c..ba85b582c5 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -1368,12 +1368,38 @@ test_expect_success 'empty subject prefix does not have extra space' ' test_cmp expect actual ' -test_expect_success '--rfc' ' +test_expect_success '--rfc and --no-rfc' ' cat >expect <<-\EOF && Subject: [RFC PATCH 1/1] header with . in it EOF git format-patch -n -1 --stdout --rfc >patch && grep "^Subject:" patch >actual && + test_cmp expect actual && + git format-patch -n -1 --stdout --rfc --no-rfc >patch && + sed -e "s/RFC //" expect >expect-raw && + grep "^Subject:" patch >actual && + test_cmp expect-raw actual +' + +test_expect_success '--rfc=WIP and --rfc=' ' + cat >expect <<-\EOF && + Subject: [WIP PATCH 1/1] header with . in it + EOF + git format-patch -n -1 --stdout --rfc=WIP >patch && + grep "^Subject:" patch >actual && + test_cmp expect actual && + git format-patch -n -1 --stdout --rfc --rfc= >patch && + sed -e "s/WIP //" expect >expect-raw && + grep "^Subject:" patch >actual && + test_cmp expect-raw actual +' + +test_expect_success '--rfc=-(WIP) appends' ' + cat >expect <<-\EOF && + Subject: [PATCH (WIP) 1/1] header with . in it + EOF + git format-patch -n -1 --stdout --rfc="-(WIP)" >patch && + grep "^Subject:" patch >actual && test_cmp expect actual ' |
