Skip to content

Commit

Permalink
Merge branch 'dz/mailinfo'
Browse files Browse the repository at this point in the history
* dz/mailinfo:
  Add a couple more test cases to the suite.
  restrict the patch filtering
  builtin-mailinfo.c infrastrcture changes
  • Loading branch information
Junio C Hamano committed Mar 14, 2007
2 parents c746e44 + ae1a743 commit 5a27b32
Show file tree
Hide file tree
Showing 13 changed files with 352 additions and 248 deletions.
550 changes: 304 additions & 246 deletions builtin-mailinfo.c

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions git-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ do
git-mailinfo $keep $utf8 "$dotest/msg" "$dotest/patch" \
<"$dotest/$msgnum" >"$dotest/info" ||
stop_here $this
test -s $dotest/patch || {
echo "Patch is empty. Was is split wrong?"
stop_here $this
}
git-stripspace < "$dotest/msg" > "$dotest/msg-clean"
;;
esac
Expand Down
4 changes: 4 additions & 0 deletions git-applymbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ do
*)
git-mailinfo $keep_subject $utf8 \
.dotest/msg .dotest/patch <$i >.dotest/info || exit 1
test -s $dotest/patch || {
echo "Patch is empty. Was is split wrong?"
stop_here $this
}
git-stripspace < .dotest/msg > .dotest/msg-clean
;;
esac
Expand Down
4 changes: 4 additions & 0 deletions git-quiltimport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ mkdir $tmp_dir || exit 2
for patch_name in $(cat "$QUILT_PATCHES/series" | grep -v '^#'); do
echo $patch_name
(cat $QUILT_PATCHES/$patch_name | git-mailinfo "$tmp_msg" "$tmp_patch" > "$tmp_info") || exit 3
test -s $dotest/patch || {
echo "Patch is empty. Was is split wrong?"
stop_here $this
}

# Parse the author information
export GIT_AUTHOR_NAME=$(sed -ne 's/Author: //p' "$tmp_info")
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. ../t5100/sample.mbox >last &&
last=`cat last` &&
echo total is $last &&
test `cat last` = 6'
test `cat last` = 8'

for mail in `echo 00*`
do
Expand Down
5 changes: 5 additions & 0 deletions t/t5100/info0007
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: another patch
Date: Fri, 9 Jun 2006 00:44:16 -0700

5 changes: 5 additions & 0 deletions t/t5100/info0008
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Author: Junio C Hamano
Email: junio@kernel.org
Subject: another patch
Date: Fri, 9 Jun 2006 00:44:16 -0700

2 changes: 2 additions & 0 deletions t/t5100/msg0007
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Here is an empty patch from A U Thor.

4 changes: 4 additions & 0 deletions t/t5100/msg0008
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
>Here is an empty patch from A U Thor.

Hey you forgot the patch!

2 changes: 1 addition & 1 deletion t/t5100/patch0005
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ diff --git a/git-cvsimport-script b/git-cvsimport-script
push(@old,$fn);

--
David K�gedal
David Kågedal
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
Expand Down
Empty file added t/t5100/patch0007
Empty file.
Empty file added t/t5100/patch0008
Empty file.
18 changes: 18 additions & 0 deletions t/t5100/sample.mbox
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,21 @@ index 9123cdc..918dcf8 100644
--
1.4.0.g6f2b

From nobody Mon Sep 17 00:00:00 2001
From: A U Thor <a.u.thor@example.com>
Date: Fri, 9 Jun 2006 00:44:16 -0700
Subject: [PATCH] another patch

Here is an empty patch from A U Thor.

From nobody Mon Sep 17 00:00:00 2001
From: Junio C Hamano <junio@kernel.org>
Date: Fri, 9 Jun 2006 00:44:16 -0700
Subject: re: [PATCH] another patch

From: A U Thor <a.u.thor@example.com>
Subject: [PATCH] another patch
>Here is an empty patch from A U Thor.

Hey you forgot the patch!

0 comments on commit 5a27b32

Please sign in to comment.