Skip to content

Commit

Permalink
Merge branch 'jc/maint-mailinfo-mime-attr' into maint
Browse files Browse the repository at this point in the history
* jc/maint-mailinfo-mime-attr:
  mailinfo: do not concatenate charset= attribute values from mime headers
  • Loading branch information
Junio C Hamano committed Sep 30, 2012
2 parents 666ca59 + 176943b commit 52938b1
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 4 deletions.
5 changes: 2 additions & 3 deletions builtin/mailinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,9 @@ static int slurp_attr(const char *line, const char *name, struct strbuf *attr)
const char *ends, *ap = strcasestr(line, name);
size_t sz;

if (!ap) {
strbuf_setlen(attr, 0);
strbuf_setlen(attr, 0);
if (!ap)
return 0;
}
ap += strlen(name);
if (*ap == '"') {
ap++;
Expand Down
2 changes: 1 addition & 1 deletion t/t5100-mailinfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test_expect_success 'split sample box' \
'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last &&
last=`cat last` &&
echo total is $last &&
test `cat last` = 16'
test `cat last` = 17'

check_mailinfo () {
mail=$1 opt=$2
Expand Down
5 changes: 5 additions & 0 deletions t/t5100/info0017
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Author: A U Thor
Email: a.u.thor@example.com
Subject: A E I O U
Date: Mon, 17 Sep 2012 14:23:44 -0700

2 changes: 2 additions & 0 deletions t/t5100/msg0017
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
New content here

6 changes: 6 additions & 0 deletions t/t5100/patch0017
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
diff --git a/foo b/foo
index e69de29..d95f3ad 100644
--- a/foo
+++ b/foo
@@ -0,0 +1 @@
+New content
16 changes: 16 additions & 0 deletions t/t5100/sample.mbox
Original file line number Diff line number Diff line change
Expand Up @@ -683,3 +683,19 @@ index e69de29..d95f3ad 100644
@@ -0,0 +1 @@
+content

From nobody Mon Sep 17 00:00:00 2001
From: A U Thor <a.u.thor@example.com>
Subject: A E I O U
Date: Mon, 17 Sep 2012 14:23:44 -0700
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-2022-jp"
Content-type: text/plain; charset="UTF-8"
New content here
diff --git a/foo b/foo
index e69de29..d95f3ad 100644
--- a/foo
+++ b/foo
@@ -0,0 +1 @@
+New content

0 comments on commit 52938b1

Please sign in to comment.