Help language development. Donate to The Perl Foundation

LibGit2 cpan:CTILMES last updated on 2020-08-18

use Test;
use Test::When <online>;
use File::Temp;
use LibGit2;

plan 18;

my $remote = '';

my $repodir = tempdir;

ok my $repo = Git::Repository.clone($remote, $repodir), 'clone';

ok my $oid ='d53bb27c0ecc26378aee6c9999012b144eba0c04'),
	'create oid';

ok my $commit = $repo.commit-lookup($oid), 'commit-lookup';

ok my $author = $, 'author';

is $, 'Curt Tilmes', 'author name';
is $, '[email protected]', 'author email';
is $author.when,'2018-02-09T18:07:07-05:00'), 'author when';

ok my $committer = $commit.committer, 'committer';

is $, 'GitHub', 'committer name';
is $, '[email protected]', 'committer email';

is $commit.type, GIT_OBJ_COMMIT, 'commit type';

is $commit.type-string, 'commit', 'commit type string';

is $commit.summary, 'Initial commit', 'summary';

is $commit.message, 'Initial commit', 'message';

is $commit.encoding, Str, 'encoding not specified';

is $commit.time,'2018-02-09T18:07:07-05:00'), 'time';

is $commit.tree-id, '75d09448ab10ddc2051b955474ac4db5f757dbbd', 'tree-id';

is $commit.parentcount, 0, 'no parent';