summaryrefslogtreecommitdiff
path: root/t/t5100-mailinfo.sh
diff options
context:
space:
mode:
authorKevin Daudt <me@ikke.info>2016-09-28 19:52:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-28 20:21:18 (GMT)
commitf357e5de31595c28a303aaf5443c26f492441a6f (patch)
treea6fd4945bc727bd523b17e7562ec989bc025e8bb /t/t5100-mailinfo.sh
parentee4d679f579b957a997830cbcd65741d9428d732 (diff)
downloadgit-f357e5de31595c28a303aaf5443c26f492441a6f.zip
git-f357e5de31595c28a303aaf5443c26f492441a6f.tar.gz
git-f357e5de31595c28a303aaf5443c26f492441a6f.tar.bz2
mailinfo: unescape quoted-pair in header fields
rfc2822 has provisions for quoted strings in structured header fields, but also allows for escaping these with so-called quoted-pairs. The only thing git currently does is removing exterior quotes, but quotes within are left alone. Remove exterior quotes and remove escape characters so that they don't show up in the author field. Signed-off-by: Kevin Daudt <me@ikke.info> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5100-mailinfo.sh')
-rwxr-xr-xt/t5100-mailinfo.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh
index 56988b7..45d228e 100755
--- a/t/t5100-mailinfo.sh
+++ b/t/t5100-mailinfo.sh
@@ -144,4 +144,18 @@ test_expect_success 'mailinfo unescapes with --mboxrd' '
test_cmp expect mboxrd/msg
'
+test_expect_success 'mailinfo handles rfc2822 quoted-string' '
+ mkdir quoted-string &&
+ git mailinfo /dev/null /dev/null <"$DATA/quoted-string.in" \
+ >quoted-string/info &&
+ test_cmp "$DATA/quoted-string.expect" quoted-string/info
+'
+
+test_expect_success 'mailinfo handles rfc2822 comment' '
+ mkdir comment &&
+ git mailinfo /dev/null /dev/null <"$DATA/comment.in" \
+ >comment/info &&
+ test_cmp "$DATA/comment.expect" comment/info
+'
+
test_done