summaryrefslogtreecommitdiff
path: root/tests/t04-commit.c
diff options
context:
space:
mode:
authorBrodie Rao <brodie@bitheap.org>2011-10-05 15:17:37 -0700
committerBrodie Rao <brodie@bitheap.org>2011-10-12 16:19:46 -0700
commit6f2856f308918455563413d012e4c4958e57ab40 (patch)
treeea8d8f0fa54851f2dc7827ca5e7f1b953a42dfee /tests/t04-commit.c
parent15b0bed2ba170526969348170d6f5e0d2ee16d7b (diff)
downloadlibgit2-6f2856f308918455563413d012e4c4958e57ab40.tar.gz
signature: don't blow up trying to parse names containing '>'
When trying to find the end of an email, instead of starting at the beginning of the signature, we start at the end of the name (after the first '<'). This brings libgit2 more in line with Git's behavior when reading out existing signatures. However, note that Git does not allow names like these through the usual porcelain; instead, it silently strips any '>' characters it sees.
Diffstat (limited to 'tests/t04-commit.c')
-rw-r--r--tests/t04-commit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/t04-commit.c b/tests/t04-commit.c
index 58d24bf73..3fb4d370c 100644
--- a/tests/t04-commit.c
+++ b/tests/t04-commit.c
@@ -412,6 +412,14 @@ BEGIN_TEST(parse1, "parse the signature line in a commit")
1234567890,
0);
+ TEST_SIGNATURE_PASS(
+ "author A U Thor> <author@example.com> and others 1234567890\n",
+ "author ",
+ "A U Thor>",
+ "author@example.com",
+ 1234567890,
+ 0);
+
TEST_SIGNATURE_FAIL(
"committer Vicent Marti tanoku@gmail.com> 123456 -0100 \n",
"committer ");