Branch Coverage

deps/libgit2/src/diff_generate.c
Criterion Covered Total %
branch 338 672 50.3


line true false branch
44 0 293 if (!delta)
48 0 293 if (delta->old_file.path == NULL) {
55 2 291 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE)) {
74 0 293 if (diff->base.opts.notify_cb) {
78 0 0 if (error) {
81 0 0 if (error > 0) /* positive value means to skip this delta */
88 0 293 if ((error = git_vector_insert(&diff->base.deltas, delta)) < 0)
108 681 0 if ((S_ISLNK(entry->mode) || S_ISREG(entry->mode)) &&
670 11 if ((S_ISLNK(entry->mode) || S_ISREG(entry->mode)) &&
43 627 if ((S_ISLNK(entry->mode) || S_ISREG(entry->mode)) &&
131 0 281 assert((oitem != NULL) ^ (nitem != NULL));
133 21 260 if (oitem) {
138 1 280 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE))
141 0 281 if ((entry->flags & GIT_INDEX_ENTRY_VALID) != 0)
144 9 272 if (status == GIT_DELTA_IGNORED &&
3 6 if (status == GIT_DELTA_IGNORED &&
148 202 76 if (status == GIT_DELTA_UNTRACKED &&
136 66 if (status == GIT_DELTA_UNTRACKED &&
152 0 142 if (status == GIT_DELTA_UNREADABLE &&
0 0 if (status == GIT_DELTA_UNREADABLE &&
156 0 142 if (!diff_pathspec_match(&matched_pathspec, diff, entry))
160 0 142 GIT_ERROR_CHECK_ALLOC(delta);
163 0 142 assert(status != GIT_DELTA_MODIFIED);
166 22 120 if (has_old) {
182 120 22 if (has_old || !git_oid_is_zero(&delta->new_file.id))
48 72 if (has_old || !git_oid_is_zero(&delta->new_file.id))
202 474 63 if (status == GIT_DELTA_UNMODIFIED &&
386 88 if (status == GIT_DELTA_UNMODIFIED &&
206 139 12 if (!new_id)
209 1 150 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE)) {
223 0 151 GIT_ERROR_CHECK_ALLOC(delta);
226 151 0 if (!git_index_entry_is_conflict(old_entry)) {
235 151 0 if (!git_index_entry_is_conflict(new_entry)) {
243 132 19 if (!git_oid_is_zero(&new_entry->id))
255 29 12 if (!delta)
261 0 0 if (git_oid__cmp(&delta->old_file.id, &item->id) == 0)
265 0 0 if (git_oid__cmp(&delta->new_file.id, &item->id) == 0)
275 0 0 if (git_oid__cmp(&delta->old_file.id, &item->id) == 0 ||
0 0 if (git_oid__cmp(&delta->old_file.id, &item->id) == 0 ||
276 0 0 (delta->new_file.mode == item->mode &&
292 604 0 if (len > 0 && prefix[len - 1] != '/')
6 598 if (len > 0 && prefix[len - 1] != '/')
300 40 0 return delta->old_file.path ?
308 0 20 return val ? val : ((int)da->status - (int)db->status);
315 0 0 return val ? val : ((int)da->status - (int)db->status);
321 108 0 uint32_t flags = opts ? opts->flags : 0;
323 0 108 if (delta->status == GIT_DELTA_UNMODIFIED &&
0 0 if (delta->status == GIT_DELTA_UNMODIFIED &&
327 2 106 if (delta->status == GIT_DELTA_IGNORED &&
0 2 if (delta->status == GIT_DELTA_IGNORED &&
331 38 70 if (delta->status == GIT_DELTA_UNTRACKED &&
0 38 if (delta->status == GIT_DELTA_UNTRACKED &&
335 0 108 if (delta->status == GIT_DELTA_UNREADABLE &&
0 0 if (delta->status == GIT_DELTA_UNREADABLE &&
353 0 0 case GIT_ITERATOR_FS: pfx = left_side ? "1" : "2"; break;
366 302 0 if (!ignore_case) {
411 302 0 assert(repo && old_iter && new_iter);
302 0 assert(repo && old_iter && new_iter);
0 302 assert(repo && old_iter && new_iter);
413 0 302 if ((diff = git__calloc(1, sizeof(git_diff_generated))) == NULL)
451 298 4 if (opts) {
455 0 298 DIFF_FLAG_SET(diff, GIT_DIFF_IGNORE_CASE, icase);
458 0 298 if (git_pathspec__vinit(&diff->pathspec, &opts->pathspec, pool) < 0)
463 53 249 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_TYPECHANGE_TREES))
467 0 302 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_SHOW_UNTRACKED_CONTENT))
471 0 302 if ((val = git_repository_config_snapshot(&cfg, repo)) < 0)
474 302 0 if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_SYMLINKS) && val)
302 0 if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_SYMLINKS) && val)
477 302 0 if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_IGNORESTAT) && val)
0 302 if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_IGNORESTAT) && val)
481 302 0 !git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_FILEMODE) && val)
484 302 0 if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_TRUSTCTIME) && val)
302 0 if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_TRUSTCTIME) && val)
490 4 298 if (!opts) {
492 4 0 diff->base.opts.context_lines = context >= 0 ? (uint32_t)context : 3;
498 2 300 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE)) {
505 0 302 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) &&
0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) &&
506 0 0 (!(diff->base.old_src == GIT_ITERATOR_WORKDIR ||
507 0 0 diff->base.new_src == GIT_ITERATOR_WORKDIR) ||
508 0 0 !(diff->base.old_src == GIT_ITERATOR_INDEX ||
513 284 18 if (diff->base.opts.ignore_submodules <= 0) {
517 0 284 if (entry && git_submodule_parse_ignore(
0 0 if (entry && git_submodule_parse_ignore(
524 3 299 if (!diff->base.opts.old_prefix || !diff->base.opts.new_prefix) {
0 3 if (!diff->base.opts.old_prefix || !diff->base.opts.new_prefix) {
528 0 299 if (git_config__get_bool_force(cfg, "diff.noprefix", 0))
530 0 299 else if (git_config__get_bool_force(cfg, "diff.mnemonicprefix", 0)) {
535 299 0 if (!diff->base.opts.old_prefix)
537 299 0 if (!diff->base.opts.new_prefix)
545 2 300 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE)) {
554 302 0 return (!diff->base.opts.old_prefix || !diff->base.opts.new_prefix) ? -1 : 0;
0 302 return (!diff->base.opts.old_prefix || !diff->base.opts.new_prefix) ? -1 : 0;
566 0 1 if (size > UINT32_MAX) {
592 0 165 assert(d->type == GIT_DIFF_TYPE_GENERATED);
597 0 165 if (git_buf_joinpath(&full_path,
601 0 165 if (!mode) {
606 0 0 if (p_stat(full_path.ptr, &st) < 0) {
617 0 165 if (S_ISGITLINK(mode)) {
620 0 0 if (!git_submodule_lookup(&sm, diff->base.repo, entry.path)) {
622 0 0 if (sm_oid)
631 0 165 } else if (S_ISLNK(mode)) {
634 0 165 } else if (!git__is_sizet(entry.file_size)) {
638 165 0 } else if (!(error = git_filter_list_load(&fl,
643 0 165 if (fd < 0)
656 165 0 if (!error && update_match && git_oid_equal(out, update_match)) {
0 165 if (!error && update_match && git_oid_equal(out, update_match)) {
0 0 if (!error && update_match && git_oid_equal(out, update_match)) {
664 0 0 if (!(error = git_repository_index__weakptr(&idx,
698 0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_SUBMODULES) ||
0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_SUBMODULES) ||
702 0 0 if ((error = git_submodule_lookup(
706 0 0 if (error == GIT_EEXISTS) {
713 0 0 if (ign <= 0 && git_submodule_ignore(sub) == GIT_SUBMODULE_IGNORE_ALL)
0 0 if (ign <= 0 && git_submodule_ignore(sub) == GIT_SUBMODULE_IGNORE_ALL)
715 0 0 else if ((error = git_submodule__status(
722 0 0 else if (!GIT_SUBMODULE_STATUS_IS_WD_UNMODIFIED(sm_status))
749 2 537 if (!diff_pathspec_match(&matched_pathspec, diff, oitem))
755 0 537 if (S_ISLNK(omode) && S_ISREG(nmode) && new_is_workdir &&
0 0 if (S_ISLNK(omode) && S_ISREG(nmode) && new_is_workdir &&
0 0 if (S_ISLNK(omode) && S_ISREG(nmode) && new_is_workdir &&
0 0 if (S_ISLNK(omode) && S_ISREG(nmode) && new_is_workdir &&
760 0 537 if (!(diff->diffcaps & GIT_DIFFCAPS_TRUST_MODE_BITS) &&
0 0 if (!(diff->diffcaps & GIT_DIFFCAPS_TRUST_MODE_BITS) &&
761 0 0 (nmode & MODE_BITS_MASK) != (omode & MODE_BITS_MASK) &&
771 0 537 } else if ((oitem->flags & GIT_INDEX_ENTRY_VALID) != 0) {
775 0 537 } else if ((oitem->flags_extended & GIT_INDEX_ENTRY_SKIP_WORKTREE) != 0) {
779 0 537 } else if (GIT_MODE_TYPE(omode) != GIT_MODE_TYPE(nmode)) {
780 0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_TYPECHANGE)) {
784 0 0 else if (nmode == GIT_FILEMODE_UNREADABLE) {
785 0 0 if (!(error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem, NULL)))
791 0 0 if (!(error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem, NULL)))
797 289 248 } else if (git_oid_equal(&oitem->id, &nitem->id) &&
289 0 } else if (git_oid_equal(&oitem->id, &nitem->id) &&
798 289 0 omode == nmode &&
805 204 44 } else if (git_oid_is_zero(&nitem->id) && new_is_workdir) {
204 0 } else if (git_oid_is_zero(&nitem->id) && new_is_workdir) {
812 0 204 if (S_ISGITLINK(nmode)) {
813 0 0 if ((error = maybe_modified_submodule(&status, &noid, diff, info)) < 0)
820 204 0 else if (omode != nmode || oitem->file_size != nitem->file_size) {
26 178 else if (omode != nmode || oitem->file_size != nitem->file_size) {
823 19 7 (oitem->file_size <= 0 && nitem->file_size > 0);
19 0 (oitem->file_size <= 0 && nitem->file_size > 0);
825 178 0 else if (!git_index_time_eq(&oitem->mtime, &nitem->mtime) ||
178 0 else if (!git_index_time_eq(&oitem->mtime, &nitem->mtime) ||
826 178 0 (use_ctime && !git_index_time_eq(&oitem->ctime, &nitem->ctime)) ||
178 0 (use_ctime && !git_index_time_eq(&oitem->ctime, &nitem->ctime)) ||
827 178 0 oitem->ino != nitem->ino ||
828 178 0 oitem->uid != nitem->uid ||
829 97 81 oitem->gid != nitem->gid ||
837 0 44 } else if (S_ISGITLINK(nmode) &&
0 0 } else if (S_ISGITLINK(nmode) &&
845 116 421 if (modified_uncertain && git_oid_is_zero(&nitem->id)) {
116 0 if (modified_uncertain && git_oid_is_zero(&nitem->id)) {
847 0 0 DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) && omode == nmode ?
848 0 116 &oitem->id : NULL;
850 0 116 if ((error = git_diff__oid_for_entry(
858 116 0 if (omode == nmode && !S_ISGITLINK(omode) &&
867 0 537 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE) &&
0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE) &&
868 0 0 DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_CASECHANGE) &&
871 0 0 if (!(error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem, NULL)))
877 116 421 return diff_delta__from_two(
889 279 103 if (!item || diff->base.pfxcomp(item->path, prefix_item->path) != 0)
169 110 if (!item || diff->base.pfxcomp(item->path, prefix_item->path) != 0)
894 2 0 return (prefix_item->path[pathlen - 1] == '/' ||
895 2 108 item->path[pathlen] == '\0' ||
0 2 item->path[pathlen] == '\0' ||
905 50 554 if ((error = git_iterator_current(entry, iterator)) == GIT_ITEROVER) {
925 795 553 while ((error = git_iterator_advance(entry, iterator)) == 0) {
927 0 0 !git_index_entry_is_conflict(prev_entry) ||
932 0 0 strcasecmp(prev_entry->path, (*entry)->path) :
935 0 0 if (cmp)
939 553 795 if (error == GIT_ITEROVER) {
953 0 114 if ((error = git_iterator_advance_into(entry, iterator)) == GIT_ITEROVER) {
968 1 10 if (error == GIT_ITEROVER) {
988 0 374 if (git_index_entry_is_conflict(nitem))
992 9 365 else if (git_iterator_current_is_ignored(info->new_iter))
995 155 219 if (nitem->mode == GIT_FILEMODE_TREE) {
999 47 0 recurse_into_dir = contains_oitem ||
1000 41 6 (delta_type == GIT_DELTA_UNTRACKED &&
1001 47 108 DIFF_FLAG_IS_SET(diff, GIT_DIFF_RECURSE_UNTRACKED_DIRS)) ||
0 41 DIFF_FLAG_IS_SET(diff, GIT_DIFF_RECURSE_UNTRACKED_DIRS)) ||
1002 0 0 (delta_type == GIT_DELTA_IGNORED &&
1006 114 41 if (recurse_into_dir && !contains_oitem) {
6 108 if (recurse_into_dir && !contains_oitem) {
1008 0 6 if (git_iterator_current_workdir_path(&full, info->new_iter) < 0)
1010 6 0 if (full && git_path_contains(full, DOT_GIT)) {
0 6 if (full && git_path_contains(full, DOT_GIT)) {
1019 41 114 if (!recurse_into_dir &&
41 0 if (!recurse_into_dir &&
1020 41 0 delta_type == GIT_DELTA_UNTRACKED &&
1027 0 41 if ((error = diff_delta__from_one(diff, delta_type, NULL, nitem)) != 0)
1032 30 11 if (!last)
1036 0 11 if ((error = iterator_advance_over(
1041 0 11 if (untracked_state == GIT_ITERATOR_STATUS_FILTERED) {
1047 11 0 if (untracked_state == GIT_ITERATOR_STATUS_IGNORED ||
1 10 if (untracked_state == GIT_ITERATOR_STATUS_IGNORED ||
1052 0 1 if (DIFF_FLAG_ISNT_SET(diff, GIT_DIFF_INCLUDE_IGNORED)) {
1062 114 0 if (recurse_into_dir) {
1066 0 114 if (error == GIT_ENOTFOUND) {
1075 9 210 else if (delta_type == GIT_DELTA_IGNORED &&
7 2 else if (delta_type == GIT_DELTA_IGNORED &&
1076 0 7 DIFF_FLAG_ISNT_SET(diff, GIT_DIFF_RECURSE_IGNORED_DIRS) &&
1081 49 170 else if (info->new_iter->type != GIT_ITERATOR_WORKDIR) {
1082 49 0 if (delta_type != GIT_DELTA_CONFLICTED)
1086 0 170 else if (nitem->mode == GIT_FILEMODE_COMMIT) {
1088 0 0 if (git_submodule_lookup(NULL, info->repo, nitem->path) != 0) {
1093 0 0 if (contains_oitem) {
1095 0 0 if (error != GIT_ENOTFOUND)
1104 0 170 else if (nitem->mode == GIT_FILEMODE_UNREADABLE) {
1105 0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED))
1112 0 219 if ((error = diff_delta__from_one(diff, delta_type, NULL, nitem)) != 0)
1118 210 9 if (delta_type != GIT_DELTA_IGNORED &&
7 203 if (delta_type != GIT_DELTA_IGNORED &&
1119 0 7 DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_TYPECHANGE_TREES) &&
1124 0 0 if (last) {
1140 0 21 if (git_index_entry_is_conflict(info->oitem))
1143 0 21 if ((error = diff_delta__from_one(diff, delta_type, info->oitem, NULL)) < 0)
1154 0 0 if (last) {
1163 0 0 if (S_ISDIR(info->nitem->mode) &&
0 0 if (S_ISDIR(info->nitem->mode) &&
1176 0 539 if ((error = maybe_modified(diff, info)) < 0)
1179 539 0 if (!(error = iterator_advance(&info->oitem, info->old_iter)))
1199 0 302 GIT_ERROR_CHECK_ALLOC(diff);
1206 0 302 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE)) {
1212 0 302 if ((error = diff_generated_apply_options(diff, opts)) < 0)
1215 302 0 if ((error = iterator_current(&info.oitem, old_iter)) < 0 ||
302 0 if ((error = iterator_current(&info.oitem, old_iter)) < 0 ||
1220 1236 0 while (!error && (info.oitem || info.nitem)) {
836 400 while (!error && (info.oitem || info.nitem)) {
98 302 while (!error && (info.oitem || info.nitem)) {
1224 925 9 if (opts && opts->progress_cb) {
0 925 if (opts && opts->progress_cb) {
1225 0 0 if ((error = opts->progress_cb(&diff->base,
0 0 if ((error = opts->progress_cb(&diff->base,
0 0 if ((error = opts->progress_cb(&diff->base,
1233 836 98 (info.nitem ? diff->base.entrycomp(info.oitem, info.nitem) : -1) : 1;
826 10 (info.nitem ? diff->base.entrycomp(info.oitem, info.nitem) : -1) : 1;
1236 21 913 if (cmp < 0)
1242 374 539 else if (cmp > 0)
1256 302 0 if (!error)
1268 0 231 GIT_ERROR_CHECK_VERSION(opts, GIT_DIFF_OPTIONS_VERSION, "git_diff_options");
1272 227 4 if (opts && (opts->flags & GIT_DIFF_DISABLE_PATHSPEC_MATCH)) {
40 187 if (opts && (opts->flags & GIT_DIFF_DISABLE_PATHSPEC_MATCH)) {
1277 187 4 } else if (opts) {
1279 0 187 GIT_ERROR_CHECK_ALLOC(prefix);
1305 18 0 assert(out && repo);
0 18 assert(out && repo);
1313 18 0 if (opts && (opts->flags & GIT_DIFF_IGNORE_CASE) != 0)
0 18 if (opts && (opts->flags & GIT_DIFF_IGNORE_CASE) != 0)
1316 18 0 if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, iflag, &b_opts, iflag, opts)) < 0 ||
18 0 if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, iflag, &b_opts, iflag, opts)) < 0 ||
1317 18 0 (error = git_iterator_for_tree(&a, old_tree, &a_opts)) < 0 ||
1318 18 0 (error = git_iterator_for_tree(&b, new_tree, &b_opts)) < 0 ||
1338 16 0 if (!error && git_index_read(*index, false) < 0)
0 16 if (!error && git_index_read(*index, false) < 0)
1361 95 0 assert(out && repo);
0 95 assert(out && repo);
1365 0 95 if (!index && (error = diff_load_index(&index, repo)) < 0)
0 0 if (!index && (error = diff_load_index(&index, repo)) < 0)
1370 95 0 if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, iflag, &b_opts, iflag, opts)) < 0 ||
95 0 if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, iflag, &b_opts, iflag, opts)) < 0 ||
1371 95 0 (error = git_iterator_for_tree(&a, old_tree, &a_opts)) < 0 ||
1372 95 0 (error = git_iterator_for_index(&b, repo, index, &b_opts)) < 0 ||
1377 0 95 if (index_ignore_case)
1404 116 0 assert(out && repo);
0 116 assert(out && repo);
1408 16 100 if (!index && (error = diff_load_index(&index, repo)) < 0)
0 16 if (!index && (error = diff_load_index(&index, repo)) < 0)
1411 116 0 if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, GIT_ITERATOR_INCLUDE_CONFLICTS,
1412 116 0 &b_opts, GIT_ITERATOR_DONT_AUTOEXPAND, opts)) < 0 ||
1413 116 0 (error = git_iterator_for_index(&a, repo, index, &a_opts)) < 0 ||
1414 116 0 (error = git_iterator_for_workdir(&b, repo, index, NULL, &b_opts)) < 0 ||
1418 0 116 if ((diff->opts.flags & GIT_DIFF_UPDATE_INDEX) && ((git_diff_generated *)diff)->index_updated)
0 0 if ((diff->opts.flags & GIT_DIFF_UPDATE_INDEX) && ((git_diff_generated *)diff)->index_updated)
1419 0 0 if ((error = git_index_write(index)) < 0)
1447 2 0 assert(out && repo);
0 2 assert(out && repo);
1451 2 0 if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, 0,
1452 2 0 &b_opts, GIT_ITERATOR_DONT_AUTOEXPAND, opts) < 0) ||
1453 2 0 (error = git_repository_index__weakptr(&index, repo)) < 0 ||
1454 2 0 (error = git_iterator_for_tree(&a, old_tree, &a_opts)) < 0 ||
1455 2 0 (error = git_iterator_for_workdir(&b, repo, index, old_tree, &b_opts)) < 0 ||
1480 0 0 assert(out && repo);
0 0 assert(out && repo);
1484 0 0 if ((error = diff_load_index(&index, repo)) < 0)
1487 0 0 if (!(error = git_diff_tree_to_index(&d1, repo, tree, index, opts)) &&
0 0 if (!(error = git_diff_tree_to_index(&d1, repo, tree, index, opts)) &&
1493 0 0 if (error) {
1516 0 0 assert(out && old_index && new_index);
0 0 assert(out && old_index && new_index);
0 0 assert(out && old_index && new_index);
1520 0 0 if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, GIT_ITERATOR_DONT_IGNORE_CASE,
1521 0 0 &b_opts, GIT_ITERATOR_DONT_IGNORE_CASE, opts) < 0) ||
1522 0 0 (error = git_iterator_for_index(&a, repo, old_index, &a_opts)) < 0 ||
1523 0 0 (error = git_iterator_for_index(&b, repo, new_index, &b_opts)) < 0 ||
1528 0 0 if (old_index->ignore_case || new_index->ignore_case)
0 0 if (old_index->ignore_case || new_index->ignore_case)
1554 62 1 i_max = head2idx ? head2idx->deltas.length : 0;
1555 62 1 j_max = idx2wd ? idx2wd->deltas.length : 0;
1556 33 30 if (!i_max && !j_max)
21 12 if (!i_max && !j_max)
1572 41 1 h2i_icase = head2idx != NULL && git_diff_is_sorted_icase(head2idx);
0 41 h2i_icase = head2idx != NULL && git_diff_is_sorted_icase(head2idx);
1573 42 0 i2w_icase = idx2wd != NULL && git_diff_is_sorted_icase(idx2wd);
0 42 i2w_icase = idx2wd != NULL && git_diff_is_sorted_icase(idx2wd);
1576 41 1 (head2idx != NULL && idx2wd != NULL && h2i_icase != i2w_icase);
41 0 (head2idx != NULL && idx2wd != NULL && h2i_icase != i2w_icase);
0 41 (head2idx != NULL && idx2wd != NULL && h2i_icase != i2w_icase);
1578 0 42 if (icase_mismatch && h2i_icase) {
0 0 if (icase_mismatch && h2i_icase) {
1583 0 42 if (i2w_icase && !icase_mismatch) {
0 0 if (i2w_icase && !icase_mismatch) {
1588 42 0 } else if (idx2wd != NULL) {
1593 38 70 for (i = 0, j = 0; i < i_max || j < j_max; ) {
28 42 for (i = 0, j = 0; i < i_max || j < j_max; ) {
1594 65 1 h2i = head2idx ? GIT_VECTOR_GET(&head2idx->deltas, i) : NULL;
38 27 h2i = head2idx ? GIT_VECTOR_GET(&head2idx->deltas, i) : NULL;
1595 66 0 i2w = idx2wd ? GIT_VECTOR_GET(&idx2wd->deltas, j) : NULL;
49 17 i2w = idx2wd ? GIT_VECTOR_GET(&idx2wd->deltas, j) : NULL;
1597 49 17 cmp = !i2w ? -1 : !h2i ? 1 :
21 28 cmp = !i2w ? -1 : !h2i ? 1 :
1600 20 46 if (cmp < 0) {
1602 36 10 } else if (cmp > 0) {
1608 0 66 if ((error = cb(h2i, i2w, payload)) != 0) {
1615 0 42 if (icase_mismatch && h2i_icase) {
0 0 if (icase_mismatch && h2i_icase) {
1621 42 0 if (idx2wd != NULL) {
1622 0 42 git_vector_set_cmp(&idx2wd->deltas,
1644 0 3 if ((parents = git_commit_parentcount(commit)) > 1) {
1653 3 0 if (parents > 0)
1654 3 0 if ((error = git_commit_parent(&parent, commit, 0)) < 0 ||
3 0 if ((error = git_commit_parent(&parent, commit, 0)) < 0 ||
1658 3 0 if ((error = git_commit_tree(&new_tree, commit)) < 0 ||
3 0 if ((error = git_commit_tree(&new_tree, commit)) < 0 ||