Branch Coverage

deps/libgit2/src/merge_file.c
Criterion Covered Total %
branch 47 104 45.1


line true false branch
39 33 0 assert(input_out && odb_object_out && odb && entry);
33 0 assert(input_out && odb_object_out && odb && entry);
33 0 assert(input_out && odb_object_out && odb && entry);
0 33 assert(input_out && odb_object_out && odb && entry);
41 0 33 if ((error = git_odb_read(odb_object_out, odb, &entry->id)) < 0)
57 11 0 if (given_opts)
86 11 0 if (ancestor) {
88 4 7 options.ancestor_label : ancestor->path;
94 4 7 options.our_label : ours->path;
99 4 7 options.their_label : theirs->path;
103 2 9 if (options.favor == GIT_MERGE_FILE_FAVOR_OURS)
105 1 8 else if (options.favor == GIT_MERGE_FILE_FAVOR_THEIRS)
107 0 8 else if (options.favor == GIT_MERGE_FILE_FAVOR_UNION)
111 0 11 XDL_MERGE_ZEALOUS_ALNUM : XDL_MERGE_ZEALOUS;
113 0 11 if (options.flags & GIT_MERGE_FILE_STYLE_DIFF3)
116 0 11 if (options.flags & GIT_MERGE_FILE_IGNORE_WHITESPACE)
118 0 11 if (options.flags & GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE)
120 0 11 if (options.flags & GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL)
123 0 11 if (options.flags & GIT_MERGE_FILE_DIFF_PATIENCE)
126 0 11 if (options.flags & GIT_MERGE_FILE_DIFF_MINIMAL)
131 0 11 if ((xdl_result = xdl_merge(&ancestor_mmfile, &our_mmfile,
138 11 0 path = git_merge_file__best_path(
143 11 0 if (path != NULL && (out->path = git__strdup(path)) == NULL) {
0 11 if (path != NULL && (out->path = git__strdup(path)) == NULL) {
151 11 0 out->mode = git_merge_file__best_mode(
157 0 11 if (error < 0)
165 33 0 size_t len = file ? file->size : 0;
167 0 33 if (len > GIT_XDIFF_MAX_SIZE)
169 0 33 if (len > GIT_MERGE_FILE_BINARY_SIZE)
172 33 0 return len ? (memchr(file->ptr, 0, len) != NULL) : false;
0 33 return len ? (memchr(file->ptr, 0, len) != NULL) : false;
185 0 0 if (given_opts && given_opts->favor == GIT_MERGE_FILE_FAVOR_OURS)
0 0 if (given_opts && given_opts->favor == GIT_MERGE_FILE_FAVOR_OURS)
187 0 0 else if (given_opts && given_opts->favor == GIT_MERGE_FILE_FAVOR_THEIRS)
0 0 else if (given_opts && given_opts->favor == GIT_MERGE_FILE_FAVOR_THEIRS)
213 0 11 merge_file__is_binary(ours) ||
226 0 0 if (!out->path)
229 0 0 if (!out->mode)
244 0 0 assert(out && ours && theirs);
0 0 assert(out && ours && theirs);
0 0 assert(out && ours && theirs);
248 0 0 if (ancestor)
271 11 0 assert(out && repo && ours && theirs);
11 0 assert(out && repo && ours && theirs);
11 0 assert(out && repo && ours && theirs);
0 11 assert(out && repo && ours && theirs);
275 0 11 if ((error = git_repository_odb(&odb, repo)) < 0)
278 11 0 if (ancestor) {
279 0 11 if ((error = merge_file_input_from_index(
286 11 0 if ((error = merge_file_input_from_index(&our_input, &odb_object[1], odb, ours)) < 0 ||
11 0 if ((error = merge_file_input_from_index(&our_input, &odb_object[1], odb, ours)) < 0 ||
304 0 17 if (result == NULL)