Skip to content

Commit 06dfc9e

Browse files
bk2204gitster
authored andcommitted
format-patch: check that header line has expected format
The format of the "From " header line is very specific to allow utilities to detect Git-style patches. Add a test that the patches created are in the expected format. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3a30aa1 commit 06dfc9e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

t/t4014-format-patch.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,4 +1438,11 @@ test_expect_success 'format-patch --zero-commit' '
14381438
test_cmp expect actual
14391439
'
14401440

1441+
test_expect_success 'From line has expected format' '
1442+
git format-patch --stdout v2..v1 >patch2 &&
1443+
grep "^From " patch2 >from &&
1444+
grep "^From $_x40 Mon Sep 17 00:00:00 2001$" patch2 >filtered &&
1445+
test_cmp from filtered
1446+
'
1447+
14411448
test_done

0 commit comments

Comments
 (0)