diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2018-10-21 14:12:52 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2018-10-21 14:12:52 +0100 |
commit | 43816e976ca1008bad55ed5e01974e0709980418 (patch) | |
tree | a98718a168d41be6dec689a09d1be38db3cdab86 /test/test-gall.commit.lua | |
parent | da80f1442f7978f149bb2136b85ae6669a408b3f (diff) | |
download | gall-master.tar.gz |
Found in https://perl5.git.perl.org/metaconfig.git by ilmari,
the commit 8004414d7809df2e2574f6c149ac592bd2d5af96 has a very
unpleasant 'author' line which git parses in a very particular
way (and which Gall failed to parse at all). This corrects that
issue, making Gall's parser match outputs with Git's
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'test/test-gall.commit.lua')
-rw-r--r-- | test/test-gall.commit.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/test-gall.commit.lua b/test/test-gall.commit.lua index 8c79080..38eb591 100644 --- a/test/test-gall.commit.lua +++ b/test/test-gall.commit.lua @@ -111,6 +111,32 @@ function suite.commit_create() local newcommit = assert(gall.commit.create(repo, commitinfo)) end +function suite.commit_create_odd_names() + local repo = test_repo() + local head = repo:get("HEAD").content + local tree = head.tree + -- Stolen very nasty author commit content from https://perl5.git.perl.org/metaconfig.git + -- commit 8004414d7809df2e2574f6c149ac592bd2d5af96 + local commit_mess = ([[ +tree %s +parent %s +author Todd C. Miller" <Todd.Miller at courtesan.com> <Todd C. Miller" <Todd.Miller at courtesan.com>> 1031751852 -0600 +committer H.Merijn Brand <h.m.brand@xs4all.nl> 1038300039 +0000 + +#17171: ld flag for shrplib on OpenBSD +From: "Todd C. Miller" <Todd.Miller at courtesan.com> + +p4raw-id: //depot/metaconfig@18181]]):format(tree.sha, head.sha) + local commitsha = repo:hash_object("commit", commit_mess, true) + local commit = repo:get(commitsha) + local person = commit.content.author + -- This is meant to replicate how Git parses the above horror... + assert(person.realname == [[Todd C. Miller"]]) + assert(person.email == "Todd.Miller at courtesan.com") + assert(person.unixtime == "1031751852") + assert(person.timezone == "-0600") +end + function suite.commit_create_no_parents_ok() local repo = test_repo() local head = repo:get("HEAD").content |