summaryrefslogtreecommitdiff
path: root/t/t5100
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
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')
-rw-r--r--t/t5100/comment.expect5
-rw-r--r--t/t5100/comment.in9
-rw-r--r--t/t5100/quoted-string.expect5
-rw-r--r--t/t5100/quoted-string.in9
4 files changed, 28 insertions, 0 deletions
diff --git a/t/t5100/comment.expect b/t/t5100/comment.expect
new file mode 100644
index 0000000..7228177
--- /dev/null
+++ b/t/t5100/comment.expect
@@ -0,0 +1,5 @@
+Author: A U Thor (this is (really) a comment (honestly))
+Email: somebody@example.com
+Subject: testing comments
+Date: Sun, 25 May 2008 00:38:18 -0700
+
diff --git a/t/t5100/comment.in b/t/t5100/comment.in
new file mode 100644
index 0000000..c53a192
--- /dev/null
+++ b/t/t5100/comment.in
@@ -0,0 +1,9 @@
+From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001
+From: "A U Thor" <somebody@example.com> (this is \(really\) a comment (honestly))
+Date: Sun, 25 May 2008 00:38:18 -0700
+Subject: [PATCH] testing comments
+
+
+
+---
+patch
diff --git a/t/t5100/quoted-string.expect b/t/t5100/quoted-string.expect
new file mode 100644
index 0000000..cab1bce
--- /dev/null
+++ b/t/t5100/quoted-string.expect
@@ -0,0 +1,5 @@
+Author: Author "The Author" Name
+Email: somebody@example.com
+Subject: testing quoted-pair
+Date: Sun, 25 May 2008 00:38:18 -0700
+
diff --git a/t/t5100/quoted-string.in b/t/t5100/quoted-string.in
new file mode 100644
index 0000000..e2e627a
--- /dev/null
+++ b/t/t5100/quoted-string.in
@@ -0,0 +1,9 @@
+From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001
+From: "Author \"The Author\" Name" <somebody@example.com>
+Date: Sun, 25 May 2008 00:38:18 -0700
+Subject: [PATCH] testing quoted-pair
+
+
+
+---
+patch