Branch Coverage

deps/libgit2/src/libgit2/diff.c
Criterion Covered Total %
branch 53 114 46.4


line true false branch
31 46 0 if (!str ||
46 0 if (!str ||
32 42 4 delta->status == GIT_DELTA_ADDED ||
33 0 42 delta->status == GIT_DELTA_RENAMED ||
44 0 23 return val ? val : ((int)da->status - (int)db->status);
51 0 0 return val ? val : ((int)da->status - (int)db->status);
72 307 353 if (!diff)
75 299 54 GIT_REFCOUNT_DEC(diff, diff->free_fn);
299 0 GIT_REFCOUNT_DEC(diff, diff->free_fn);
85 0 59 GIT_ASSERT_ARG(diff);
94 0 0 GIT_ASSERT_ARG(diff);
96 0 0 git_vector_foreach(&diff->deltas, i, delta) {
105 0 61 GIT_ASSERT_ARG_WITH_RETVAL(diff, NULL);
116 0 0 GIT_ASSERT_ARG(out);
117 0 0 GIT_ERROR_CHECK_VERSION(out, GIT_DIFF_PERFDATA_VERSION, "git_diff_perfdata");
135 0 22 GIT_ASSERT_ARG(diff);
137 32 21 git_vector_foreach(&diff->deltas, idx, delta) {
141 0 32 if (git_diff_delta__should_skip(&diff->opts, delta))
144 0 32 if ((error = git_patch_from_diff(&patch, diff, idx)) != 0)
151 1 31 if (error)
169 0 0 GIT_ASSERT_ARG(out);
170 0 0 GIT_ASSERT_ARG(diff);
171 0 0 GIT_ASSERT_ARG(opts && opts->summary && opts->id && opts->author);
0 0 GIT_ASSERT_ARG(opts && opts->summary && opts->id && opts->author);
0 0 GIT_ASSERT_ARG(opts && opts->summary && opts->id && opts->author);
0 0 GIT_ASSERT_ARG(opts && opts->summary && opts->id && opts->author);
173 0 0 GIT_ERROR_CHECK_VERSION(opts,
186 0 0 if ((opts->flags & GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER) != 0)
193 0 0 if (error < 0)
219 0 3 GIT_ASSERT_ARG(out);
220 0 3 GIT_ASSERT_ARG(repo);
221 0 3 GIT_ASSERT_ARG(commit);
228 1 2 if ((flags & GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER) != 0)
231 0 3 if ((error = git_diff__commit(&diff, repo, commit, diff_opts)) < 0)
254 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(
270 0 1 GIT_INIT_STRUCTURE_FROM_TEMPLATE(
278 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(
289 2 0 if ((error = git_hash_final(hash.id, ctx)) < 0 ||
0 2 if ((error = git_hash_final(hash.id, ctx)) < 0 ||
293 40 2 for (i = 0; i < GIT_OID_RAWSZ; i++) {
308 134 5 while ((c = *src++) != '\0') {
309 110 24 if (!git__isspace(c)) {
328 5 0 if (line->origin == GIT_DIFF_LINE_CONTEXT_EOFNL ||
5 0 if (line->origin == GIT_DIFF_LINE_CONTEXT_EOFNL ||
329 5 0 line->origin == GIT_DIFF_LINE_ADD_EOFNL ||
333 0 5 if ((error = git_diff_print_callback__to_buf(delta, hunk,
339 2 3 if (line->origin == GIT_DIFF_LINE_FILE_HDR &&
1 1 if (line->origin == GIT_DIFF_LINE_FILE_HDR &&
340 0 1 !args->first_file &&
344 0 5 if ((error = git_hash_update(&args->ctx, buf.ptr, buf.size)) < 0)
347 2 3 if (line->origin == GIT_DIFF_LINE_FILE_HDR && args->first_file)
1 1 if (line->origin == GIT_DIFF_LINE_FILE_HDR && args->first_file)
357 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(
367 0 1 GIT_ERROR_CHECK_VERSION(
372 0 1 if ((error = git_hash_ctx_init(&args.ctx, GIT_HASH_ALGORITHM_SHA1)) < 0)
375 0 1 if ((error = git_diff_print(diff,
381 0 1 if ((error = (flush_hunk(&args.result, &args.ctx))) < 0)