summaryrefslogtreecommitdiff
path: root/t/t4014-format-patch.sh
diff options
context:
space:
mode:
authorDaniel Barkalow <barkalow@iabervon.org>2008-02-18 22:56:13 -0500
committerJunio C Hamano <gitster@pobox.com>2008-02-19 21:49:31 -0800
commita5a27c79b7e77e28462b6d089e827391b67d3e5f (patch)
treede06f8d2a710cff43f0e7db22463d6f651310117 /t/t4014-format-patch.sh
parentb02bd65f679024ce25afeddf7e96d6d7aea5fca6 (diff)
downloadgit-a5a27c79b7e77e28462b6d089e827391b67d3e5f.tar.gz
Add a --cover-letter option to format-patch
If --cover-letter is provided, generate a cover letter message before the patches, numbered 0. Original patch thanks to Johannes Schindelin Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4014-format-patch.sh')
-rwxr-xr-xt/t4014-format-patch.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 6e8b5f4516..ac78752067 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -122,6 +122,32 @@ test_expect_success 'thread in-reply-to' '
done
'
+test_expect_success 'thread cover-letter' '
+
+ rm -rf patches/ &&
+ git checkout side &&
+ git format-patch --cover-letter --thread -o patches/ master &&
+ FIRST_MID=$(grep "Message-Id:" patches/0000-* | sed "s/^[^<]*\(<[^>]*>\).*$/\1/") &&
+ for i in patches/0001-* patches/0002-* patches/0003-*
+ do
+ grep "References: $FIRST_MID" $i &&
+ grep "In-Reply-To: $FIRST_MID" $i
+ done
+'
+
+test_expect_success 'thread cover-letter in-reply-to' '
+
+ rm -rf patches/ &&
+ git checkout side &&
+ git format-patch --cover-letter --in-reply-to="<test.message>" --thread -o patches/ master &&
+ FIRST_MID="<test.message>" &&
+ for i in patches/*
+ do
+ grep "References: $FIRST_MID" $i &&
+ grep "In-Reply-To: $FIRST_MID" $i
+ done
+'
+
test_expect_success 'excessive subject' '
rm -rf patches/ &&