xs/AnnotatedCommit.xs

filter: Statementstmt 100% 11 / 11 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 13 / 13 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« deps/libgit2/src/util/unix/realpath.c ↑ Summary xs/Blame/Hunk.xs »
1 MODULE = Git::Raw PACKAGE = Git::Raw::AnnotatedCommit
2  
3 SV *
4 id(self)
5 AnnotatedCommit self
6  
7 CODE:
8 9 RETVAL = git_oid_to_sv(git_annotated_commit_id(self));
9  
10 OUTPUT: RETVAL
11  
12 SV *
13 lookup(class, repo, id)
14 SV *class
15 SV *repo
16 SV *id
17  
18 PREINIT:
19 int rc;
20  
21 git_oid oid;
22 AnnotatedCommit commit;
23 Repository repo_ptr;
24  
25 CODE:
26 2 rc = git_oid_fromstr(&oid, git_ensure_pv(id, "id"));
27 2 git_check_error(rc);
28  
29 2 repo_ptr = GIT_SV_TO_PTR(Repository, repo);
30  
31 2 rc = git_annotated_commit_lookup(&commit,
32 repo_ptr -> repository, &oid
33 );
34 2 ▶ if (rc == GIT_ENOTFOUND)
Branch: 1 branch
BranchTrueFalseTotal
if (rc == GIT_ENOTFOUND) 1 1 2
35 1 XSRETURN_UNDEF;
36  
37 1 git_check_error(rc);
38  
39 2 GIT_NEW_OBJ_WITH_MAGIC(
40 RETVAL, SvPVbyte_nolen(class), commit, SvRV(repo)
41 );
42  
43 OUTPUT: RETVAL
44  
45 void
46 DESTROY(self)
47 SV *self
48  
49 CODE:
50 12 git_annotated_commit_free(GIT_SV_TO_PTR(AnnotatedCommit, self));
51 12 SvREFCNT_dec(GIT_SV_TO_MAGIC(self));
« deps/libgit2/src/util/unix/realpath.c ↑ Summary xs/Blame/Hunk.xs »