Branch Coverage

xs/Repository.xs
Criterion Covered Total %
branch 153 196 78.0


line true false branch
50 0 0 if (items >= 5) {
58 0 0 if (items >= 6) {
123 1 0 if (rc == GIT_OK)
199 2 16 if (items >= 2) {
201 1 1 if (!SvOK(ST(1))) {
1 0 if (!SvOK(ST(1))) {
1 0 if (!SvOK(ST(1))) {
241 2 4 if (items >= 2) {
277 19 59 if (items >= 2) {
334 0 1 if (git_sv_to_commitish(repo -> repository, commitish, &id) == NULL)
368 1 2 if (rc == GIT_ENOTFOUND) {
411 1 2 if ((lopt = git_hv_list_entry(opts, "paths"))) {
417 2 1 while ((path = av_fetch(lopt, i++, 0))) {
418 1 1 if (!SvOK(*path))
1 0 if (!SvOK(*path))
1 0 if (!SvOK(*path))
421 0 1 Renew(paths.strings, count + 1, char *);
422 1 0 paths.strings[count++] = SvPVbyte_nolen(*path);
430 2 0 } else if ((opt = git_hv_string_entry(opts, "type"))) {
432 2 0 const char *type_str = SvPVbyte_nolen(opt);
434 0 2 if (strcmp(type_str, "soft") == 0)
436 0 2 else if (strcmp(type_str, "mixed") == 0)
438 1 1 else if (strcmp(type_str, "hard") == 0)
466 15 42 if ((hopt = git_hv_hash_entry(opts, "flags")))
469 4 53 if ((opt = git_hv_string_entry(opts, "show"))) {
470 4 0 const char *show_str = SvPVbyte_nolen(opt);
472 1 3 if (strcmp(show_str, "index_and_worktree") == 0)
474 1 2 else if (strcmp(show_str, "index") == 0)
476 1 1 else if (strcmp(show_str, "worktree") == 0)
484 6 50 if (items > 2) {
485 0 6 Newx(status_opts.pathspec.strings, items - 2, char *);
487 6 6 for (i = 2; i < items; i++) {
490 6 0 SvPVbyte_nolen(ST(i));
502 54 56 for (i = 0; i < count; i++) {
512 12 42 if (entry -> status & GIT_STATUS_INDEX_NEW)
515 10 44 if (entry -> status & GIT_STATUS_INDEX_MODIFIED)
518 1 53 if (entry -> status & GIT_STATUS_INDEX_DELETED)
521 2 52 if (entry -> status & GIT_STATUS_INDEX_RENAMED)
524 21 33 if (entry -> status & GIT_STATUS_WT_NEW)
527 9 45 if (entry -> status & GIT_STATUS_WT_MODIFIED)
530 1 53 if (entry -> status & GIT_STATUS_WT_DELETED)
533 1 53 if (entry -> status & GIT_STATUS_WT_RENAMED)
536 0 54 if (entry -> status & GIT_STATUS_WT_UNREADABLE)
539 4 50 if (entry -> status & GIT_STATUS_IGNORED)
542 0 54 if (entry -> status & GIT_STATUS_CONFLICTED)
547 36 18 if (entry -> index_to_workdir) {
548 1 35 if (entry -> status & GIT_STATUS_WT_RENAMED) {
559 25 29 if (entry -> head_to_index) {
560 2 23 if (entry -> status & GIT_STATUS_INDEX_RENAMED) {
568 18 7 if (!path)
587 1 1 if (git_repository_is_worktree (self -> repository))
643 7 0 if (items == 2) {
648 7 0 if (tree) {
659 4 3 if (diff_opts.pathspec.count > 0)
682 1 11 if (items < 3)
688 0 11 Renew(oids, count, git_oid);
689 22 8 for (i = 0; i < count; ++i) {
690 3 19 if (git_sv_to_commitish(repo_ptr -> repository, ST(i + 1), oids + i) == NULL) {
701 8 0 if (rc != GIT_ENOTFOUND) {
739 4 1 if (analysis & GIT_MERGE_ANALYSIS_NORMAL)
741 1 4 if (analysis & GIT_MERGE_ANALYSIS_UP_TO_DATE)
743 1 4 if (analysis & GIT_MERGE_ANALYSIS_FASTFORWARD)
745 0 5 if (analysis & GIT_MERGE_ANALYSIS_UNBORN)
770 6 2 if (items >= 3) {
775 2 3 if (items >= 4) {
807 2 1 if (items == 2) {
810 1 1 if (strcmp(type_str, "local") == 0)
812 0 1 else if (strcmp(type_str, "remote") == 0)
814 0 1 else if (strcmp(type_str, "all") == 0)
827 4 2 while ((rc = git_branch_next(&branch, &type, itr)) == 0) {
834 0 4 mXPUSHs(perl_ref);
863 7 3 for (i = 0; i < remotes.count; i++) {
878 0 7 mXPUSHs(perl_ref);
906 4 3 while ((rc = git_reference_next(&ref, itr)) == 0) {
913 0 4 mXPUSHs(perl_ref);
947 2 32 if (items == 2) {
996 2 5 if (items >= 3) {
1001 2 5 if (items >= 4) {
1006 2 5 if (items >= 5) {
1010 2 0 if (mainline < 0 || mainline > (int) git_commit_parentcount(commit) - 1)
1 1 if (mainline < 0 || mainline > (int) git_commit_parentcount(commit) - 1)
1039 2 0 if (items >= 3) {
1044 2 0 if (items >= 4) {
1049 2 0 if (items >= 5) {
1053 2 0 if (mainline < 0 || mainline > (int) git_commit_parentcount(commit) - 1)
1 1 if (mainline < 0 || mainline > (int) git_commit_parentcount(commit) - 1)
1080 11 0 ctx = GIMME_V;
1087 9 1 if (ctx != G_VOID) {
1088 7 2 if (ctx == G_ARRAY) {
1089 0 7 mXPUSHs(git_obj_to_sv(rs.from, SvRV(self)));
1090 4 3 if (rs.flags & GIT_REVPARSE_SINGLE) {
1093 0 3 mXPUSHs(git_obj_to_sv(rs.to, SvRV(self)));
1097 1 1 if (rs.flags & GIT_REVPARSE_SINGLE)
1098 0 1 mXPUSHs(newSViv(1));
1100 0 1 mXPUSHs(newSViv(2));
1106 1 9 if (count == 0) {
1198 1 0 if (rc == GIT_OK)
1247 36 0 if (self -> owned)