Branch Coverage

deps/libgit2/src/status.c
Criterion Covered Total %
branch 99 204 48.5


line true false branch
43 0 2 if (!git_oid_equal(&head2idx->old_file.id, &head2idx->new_file.id))
85 1 0 if (!git_oid_equal(&idx2wd->old_file.id, &idx2wd->new_file.id)) {
89 0 1 if (git_oid_is_zero(&idx2wd->old_file.id) &&
0 0 if (git_oid_is_zero(&idx2wd->old_file.id) &&
90 0 0 diff->old_src == GIT_ITERATOR_WORKDIR &&
96 1 0 if (git_oid_is_zero(&idx2wd->new_file.id) &&
1 0 if (git_oid_is_zero(&idx2wd->new_file.id) &&
97 1 0 diff->new_src == GIT_ITERATOR_WORKDIR &&
103 0 1 if (!git_oid_equal(&idx2wd->old_file.id, &idx2wd->new_file.id))
125 54 12 if (!(status->opts.flags & GIT_STATUS_OPT_EXCLUDE_SUBMODULES))
129 5 7 if (head2idx) {
130 3 2 if (head2idx->status != GIT_DELTA_ADDED &&
3 0 if (head2idx->status != GIT_DELTA_ADDED &&
133 2 0 if (head2idx->status != GIT_DELTA_DELETED &&
2 0 if (head2idx->status != GIT_DELTA_DELETED &&
137 7 0 if (idx2wd) {
138 7 0 if (idx2wd->status != GIT_DELTA_ADDED &&
7 0 if (idx2wd->status != GIT_DELTA_ADDED &&
141 0 0 if (idx2wd->status != GIT_DELTA_DELETED &&
0 0 if (idx2wd->status != GIT_DELTA_DELETED &&
157 30 36 if (head2idx)
160 46 20 if (idx2wd)
174 0 66 if (!status_is_included(status, head2idx, idx2wd))
178 0 66 GIT_ERROR_CHECK_ALLOC(status_entry);
196 8 1 delta_a = entry_a->index_to_workdir ? entry_a->index_to_workdir :
198 8 1 delta_b = entry_b->index_to_workdir ? entry_b->index_to_workdir :
201 0 9 if (!delta_a && delta_b)
0 0 if (!delta_a && delta_b)
203 9 0 if (delta_a && !delta_b)
0 9 if (delta_a && !delta_b)
205 0 9 if (!delta_a && !delta_b)
0 0 if (!delta_a && !delta_b)
226 0 63 if (!(status = git__calloc(1, sizeof(git_status_list))))
229 0 63 entrycmp = index->ignore_case ? status_entry_icmp : status_entry_cmp;
231 0 63 if (git_vector_init(&status->paired, 0, entrycmp) < 0) {
241 0 63 if (!opts)
244 0 63 GIT_ERROR_CHECK_VERSION(opts, GIT_STATUS_OPTIONS_VERSION, "git_status_options");
246 0 63 if (opts->show > GIT_STATUS_SHOW_WORKDIR_ONLY) {
251 0 63 if ((opts->flags & GIT_STATUS_OPT_NO_REFRESH) != 0 &&
0 0 if ((opts->flags & GIT_STATUS_OPT_NO_REFRESH) != 0 &&
272 63 0 opts ? opts->show : GIT_STATUS_SHOW_INDEX_AND_WORKDIR;
274 63 0 unsigned int flags = opts ? opts->flags : GIT_STATUS_OPT_DEFAULTS;
278 0 63 if (status_validate_options(opts) < 0)
281 63 0 if ((error = git_repository__ensure_not_bare(repo, "status")) < 0 ||
0 63 if ((error = git_repository__ensure_not_bare(repo, "status")) < 0 ||
285 63 0 if (opts != NULL && opts->baseline != NULL) {
0 63 if (opts != NULL && opts->baseline != NULL) {
289 14 49 if ((error = git_repository_head_tree(&head, repo)) < 0) {
290 14 0 if (error != GIT_ENOTFOUND && error != GIT_EUNBORNBRANCH)
0 14 if (error != GIT_ENOTFOUND && error != GIT_EUNBORNBRANCH)
302 0 63 GIT_ERROR_CHECK_ALLOC(status);
304 63 0 if (opts) {
312 12 51 if ((flags & GIT_STATUS_OPT_INCLUDE_UNTRACKED) != 0)
314 4 59 if ((flags & GIT_STATUS_OPT_INCLUDE_IGNORED) != 0)
316 0 63 if ((flags & GIT_STATUS_OPT_INCLUDE_UNMODIFIED) != 0)
318 1 62 if ((flags & GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS) != 0)
320 0 63 if ((flags & GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH) != 0)
322 1 62 if ((flags & GIT_STATUS_OPT_RECURSE_IGNORED_DIRS) != 0)
324 7 56 if ((flags & GIT_STATUS_OPT_EXCLUDE_SUBMODULES) != 0)
326 0 63 if ((flags & GIT_STATUS_OPT_UPDATE_INDEX) != 0)
328 0 63 if ((flags & GIT_STATUS_OPT_INCLUDE_UNREADABLE) != 0)
330 0 63 if ((flags & GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED) != 0)
333 0 63 if ((flags & GIT_STATUS_OPT_RENAMES_FROM_REWRITES) != 0)
339 62 1 if (show != GIT_STATUS_SHOW_WORKDIR_ONLY) {
340 0 62 if ((error = git_diff_tree_to_index(
344 2 60 if ((flags & GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX) != 0 &&
0 2 if ((flags & GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX) != 0 &&
349 62 1 if (show != GIT_STATUS_SHOW_INDEX_ONLY) {
350 0 62 if ((error = git_diff_index_to_workdir(
355 3 59 if ((flags & GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR) != 0 &&
0 3 if ((flags & GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR) != 0 &&
362 0 63 if (error < 0)
365 0 63 if (flags & GIT_STATUS_OPT_SORT_CASE_SENSITIVELY)
367 0 63 if (flags & GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY)
370 5 58 if ((flags &
378 0 63 if (error < 0) {
385 63 0 if (opts == NULL || opts->baseline != head)
49 14 if (opts == NULL || opts->baseline != head)
394 0 56 assert(status);
401 0 54 assert(status);
408 0 63 if (status == NULL)
431 0 7 if ((error = git_status_list_new(&status, repo, opts)) < 0) {
435 6 1 git_vector_foreach(&status->paired, i, status_entry) {
437 4 2 status_entry->head_to_index->old_file.path :
440 6 0 if ((error = cb(path, status_entry->status, payload)) != 0) {
472 0 0 strcomp = (sfi->wildmatch_flags & WM_CASEFOLD) ? git__strcasecmp : git__strcmp;
475 0 0 (strcomp(sfi->expected, path) != 0 &&
495 0 0 assert(status_flags && repo && path);
0 0 assert(status_flags && repo && path);
0 0 assert(status_flags && repo && path);
497 0 0 if ((error = git_repository_index__weakptr(&index, repo)) < 0)
500 0 0 if ((sfi.expected = git__strdup(path)) == NULL)
502 0 0 if (index->ignore_case)
517 0 0 if (error < 0 && sfi.ambiguous) {
0 0 if (error < 0 && sfi.ambiguous) {
523 0 0 if (!error && !sfi.count) {
0 0 if (!error && !sfi.count) {
546 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(
559 0 0 assert(out);
560 0 0 GIT_ERROR_CHECK_VERSION(out, GIT_DIFF_PERFDATA_VERSION, "git_diff_perfdata");
565 0 0 if (status->head2idx) {
569 0 0 if (status->idx2wd) {