Branch Coverage

deps/libgit2/src/diff_generate.c
Criterion Covered Total %
branch 339 674 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)
428 0 302 if (git_vector_init(&diff->base.deltas, 0, git_diff_delta__cmp) < 0) {
452 298 4 if (opts) {
456 0 298 DIFF_FLAG_SET(diff, GIT_DIFF_IGNORE_CASE, icase);
459 0 298 if (git_pathspec__vinit(&diff->pathspec, &opts->pathspec, pool) < 0)
464 53 249 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_TYPECHANGE_TREES))
468 0 302 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_SHOW_UNTRACKED_CONTENT))
472 0 302 if ((val = git_repository_config_snapshot(&cfg, repo)) < 0)
475 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)
478 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)
482 302 0 !git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_FILEMODE) && val)
485 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)
491 4 298 if (!opts) {
493 4 0 diff->base.opts.context_lines = context >= 0 ? (uint32_t)context : 3;
499 2 300 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE)) {
506 0 302 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) &&
0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) &&
507 0 0 (!(diff->base.old_src == GIT_ITERATOR_WORKDIR ||
508 0 0 diff->base.new_src == GIT_ITERATOR_WORKDIR) ||
509 0 0 !(diff->base.old_src == GIT_ITERATOR_INDEX ||
514 284 18 if (diff->base.opts.ignore_submodules <= 0) {
518 0 284 if (entry && git_submodule_parse_ignore(
0 0 if (entry && git_submodule_parse_ignore(
525 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) {
529 0 299 if (git_config__get_bool_force(cfg, "diff.noprefix", 0))
531 0 299 else if (git_config__get_bool_force(cfg, "diff.mnemonicprefix", 0)) {
536 299 0 if (!diff->base.opts.old_prefix)
538 299 0 if (!diff->base.opts.new_prefix)
546 2 300 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE)) {
555 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;
567 0 1 if (size > UINT32_MAX) {
593 0 124 assert(d->type == GIT_DIFF_TYPE_GENERATED);
598 0 124 if (git_buf_joinpath(&full_path,
602 0 124 if (!mode) {
607 0 0 if (p_stat(full_path.ptr, &st) < 0) {
618 0 124 if (S_ISGITLINK(mode)) {
621 0 0 if (!git_submodule_lookup(&sm, diff->base.repo, entry.path)) {
623 0 0 if (sm_oid)
632 0 124 } else if (S_ISLNK(mode)) {
635 0 124 } else if (!git__is_sizet(entry.file_size)) {
639 124 0 } else if (!(error = git_filter_list_load(&fl,
644 0 124 if (fd < 0)
657 124 0 if (!error && update_match && git_oid_equal(out, update_match)) {
0 124 if (!error && update_match && git_oid_equal(out, update_match)) {
0 0 if (!error && update_match && git_oid_equal(out, update_match)) {
665 0 0 if (!(error = git_repository_index__weakptr(&idx,
699 0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_SUBMODULES) ||
0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_SUBMODULES) ||
703 0 0 if ((error = git_submodule_lookup(
707 0 0 if (error == GIT_EEXISTS) {
714 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)
716 0 0 else if ((error = git_submodule__status(
723 0 0 else if (!GIT_SUBMODULE_STATUS_IS_WD_UNMODIFIED(sm_status))
750 2 537 if (!diff_pathspec_match(&matched_pathspec, diff, oitem))
756 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 &&
761 0 537 if (!(diff->diffcaps & GIT_DIFFCAPS_TRUST_MODE_BITS) &&
0 0 if (!(diff->diffcaps & GIT_DIFFCAPS_TRUST_MODE_BITS) &&
762 0 0 (nmode & MODE_BITS_MASK) != (omode & MODE_BITS_MASK) &&
772 0 537 } else if ((oitem->flags & GIT_INDEX_ENTRY_VALID) != 0) {
776 0 537 } else if ((oitem->flags_extended & GIT_INDEX_ENTRY_SKIP_WORKTREE) != 0) {
780 0 537 } else if (GIT_MODE_TYPE(omode) != GIT_MODE_TYPE(nmode)) {
781 0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_TYPECHANGE)) {
785 0 0 else if (nmode == GIT_FILEMODE_UNREADABLE) {
786 0 0 if (!(error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem, NULL)))
792 0 0 if (!(error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem, NULL)))
798 289 248 } else if (git_oid_equal(&oitem->id, &nitem->id) &&
289 0 } else if (git_oid_equal(&oitem->id, &nitem->id) &&
799 289 0 omode == nmode &&
806 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) {
813 0 204 if (S_ISGITLINK(nmode)) {
814 0 0 if ((error = maybe_modified_submodule(&status, &noid, diff, info)) < 0)
821 204 0 else if (omode != nmode || oitem->file_size != nitem->file_size) {
26 178 else if (omode != nmode || oitem->file_size != nitem->file_size) {
824 19 7 (oitem->file_size <= 0 && nitem->file_size > 0);
19 0 (oitem->file_size <= 0 && nitem->file_size > 0);
826 178 0 else if (!git_index_time_eq(&oitem->mtime, &nitem->mtime) ||
178 0 else if (!git_index_time_eq(&oitem->mtime, &nitem->mtime) ||
827 178 0 (use_ctime && !git_index_time_eq(&oitem->ctime, &nitem->ctime)) ||
178 0 (use_ctime && !git_index_time_eq(&oitem->ctime, &nitem->ctime)) ||
828 178 0 oitem->ino != nitem->ino ||
829 178 0 oitem->uid != nitem->uid ||
830 97 81 oitem->gid != nitem->gid ||
838 0 44 } else if (S_ISGITLINK(nmode) &&
0 0 } else if (S_ISGITLINK(nmode) &&
846 116 421 if (modified_uncertain && git_oid_is_zero(&nitem->id)) {
116 0 if (modified_uncertain && git_oid_is_zero(&nitem->id)) {
848 0 0 DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) && omode == nmode ?
849 0 116 &oitem->id : NULL;
851 0 116 if ((error = git_diff__oid_for_entry(
859 116 0 if (omode == nmode && !S_ISGITLINK(omode) &&
868 0 537 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE) &&
0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE) &&
869 0 0 DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_CASECHANGE) &&
872 0 0 if (!(error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem, NULL)))
878 116 421 return diff_delta__from_two(
890 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)
895 2 0 return (prefix_item->path[pathlen - 1] == '/' ||
896 2 108 item->path[pathlen] == '\0' ||
0 2 item->path[pathlen] == '\0' ||
906 50 554 if ((error = git_iterator_current(entry, iterator)) == GIT_ITEROVER) {
926 795 553 while ((error = git_iterator_advance(entry, iterator)) == 0) {
928 0 0 !git_index_entry_is_conflict(prev_entry) ||
933 0 0 strcasecmp(prev_entry->path, (*entry)->path) :
936 0 0 if (cmp)
940 553 795 if (error == GIT_ITEROVER) {
954 0 114 if ((error = git_iterator_advance_into(entry, iterator)) == GIT_ITEROVER) {
969 1 10 if (error == GIT_ITEROVER) {
989 0 374 if (git_index_entry_is_conflict(nitem))
993 9 365 else if (git_iterator_current_is_ignored(info->new_iter))
996 155 219 if (nitem->mode == GIT_FILEMODE_TREE) {
1000 47 0 recurse_into_dir = contains_oitem ||
1001 41 6 (delta_type == GIT_DELTA_UNTRACKED &&
1002 47 108 DIFF_FLAG_IS_SET(diff, GIT_DIFF_RECURSE_UNTRACKED_DIRS)) ||
0 41 DIFF_FLAG_IS_SET(diff, GIT_DIFF_RECURSE_UNTRACKED_DIRS)) ||
1003 0 0 (delta_type == GIT_DELTA_IGNORED &&
1007 114 41 if (recurse_into_dir && !contains_oitem) {
6 108 if (recurse_into_dir && !contains_oitem) {
1009 0 6 if (git_iterator_current_workdir_path(&full, info->new_iter) < 0)
1011 6 0 if (full && git_path_contains(full, DOT_GIT)) {
0 6 if (full && git_path_contains(full, DOT_GIT)) {
1020 41 114 if (!recurse_into_dir &&
41 0 if (!recurse_into_dir &&
1021 41 0 delta_type == GIT_DELTA_UNTRACKED &&
1028 0 41 if ((error = diff_delta__from_one(diff, delta_type, NULL, nitem)) != 0)
1033 30 11 if (!last)
1037 0 11 if ((error = iterator_advance_over(
1042 0 11 if (untracked_state == GIT_ITERATOR_STATUS_FILTERED) {
1048 11 0 if (untracked_state == GIT_ITERATOR_STATUS_IGNORED ||
1 10 if (untracked_state == GIT_ITERATOR_STATUS_IGNORED ||
1053 0 1 if (DIFF_FLAG_ISNT_SET(diff, GIT_DIFF_INCLUDE_IGNORED)) {
1063 114 0 if (recurse_into_dir) {
1067 0 114 if (error == GIT_ENOTFOUND) {
1076 9 210 else if (delta_type == GIT_DELTA_IGNORED &&
7 2 else if (delta_type == GIT_DELTA_IGNORED &&
1077 0 7 DIFF_FLAG_ISNT_SET(diff, GIT_DIFF_RECURSE_IGNORED_DIRS) &&
1082 49 170 else if (info->new_iter->type != GIT_ITERATOR_WORKDIR) {
1083 49 0 if (delta_type != GIT_DELTA_CONFLICTED)
1087 0 170 else if (nitem->mode == GIT_FILEMODE_COMMIT) {
1089 0 0 if (git_submodule_lookup(NULL, info->repo, nitem->path) != 0) {
1094 0 0 if (contains_oitem) {
1096 0 0 if (error != GIT_ENOTFOUND)
1105 0 170 else if (nitem->mode == GIT_FILEMODE_UNREADABLE) {
1106 0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED))
1113 0 219 if ((error = diff_delta__from_one(diff, delta_type, NULL, nitem)) != 0)
1119 210 9 if (delta_type != GIT_DELTA_IGNORED &&
7 203 if (delta_type != GIT_DELTA_IGNORED &&
1120 0 7 DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_TYPECHANGE_TREES) &&
1125 0 0 if (last) {
1141 0 21 if (git_index_entry_is_conflict(info->oitem))
1144 0 21 if ((error = diff_delta__from_one(diff, delta_type, info->oitem, NULL)) < 0)
1155 0 0 if (last) {
1164 0 0 if (S_ISDIR(info->nitem->mode) &&
0 0 if (S_ISDIR(info->nitem->mode) &&
1177 0 539 if ((error = maybe_modified(diff, info)) < 0)
1180 539 0 if (!(error = iterator_advance(&info->oitem, info->old_iter)))
1200 0 302 GIT_ERROR_CHECK_ALLOC(diff);
1207 0 302 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE)) {
1213 0 302 if ((error = diff_generated_apply_options(diff, opts)) < 0)
1216 302 0 if ((error = iterator_current(&info.oitem, old_iter)) < 0 ||
302 0 if ((error = iterator_current(&info.oitem, old_iter)) < 0 ||
1221 1236 0 while (!error && (info.oitem || info.nitem)) {
836 400 while (!error && (info.oitem || info.nitem)) {
98 302 while (!error && (info.oitem || info.nitem)) {
1225 925 9 if (opts && opts->progress_cb) {
0 925 if (opts && opts->progress_cb) {
1226 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,
1234 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;
1237 21 913 if (cmp < 0)
1243 374 539 else if (cmp > 0)
1257 302 0 if (!error)
1269 0 231 GIT_ERROR_CHECK_VERSION(opts, GIT_DIFF_OPTIONS_VERSION, "git_diff_options");
1273 227 4 if (opts && (opts->flags & GIT_DIFF_DISABLE_PATHSPEC_MATCH)) {
40 187 if (opts && (opts->flags & GIT_DIFF_DISABLE_PATHSPEC_MATCH)) {
1278 187 4 } else if (opts) {
1280 0 187 GIT_ERROR_CHECK_ALLOC(prefix);
1306 18 0 assert(out && repo);
0 18 assert(out && repo);
1314 18 0 if (opts && (opts->flags & GIT_DIFF_IGNORE_CASE) != 0)
0 18 if (opts && (opts->flags & GIT_DIFF_IGNORE_CASE) != 0)
1317 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 ||
1318 18 0 (error = git_iterator_for_tree(&a, old_tree, &a_opts)) < 0 ||
1319 18 0 (error = git_iterator_for_tree(&b, new_tree, &b_opts)) < 0 ||
1339 16 0 if (!error && git_index_read(*index, false) < 0)
0 16 if (!error && git_index_read(*index, false) < 0)
1362 95 0 assert(out && repo);
0 95 assert(out && repo);
1366 0 95 if (!index && (error = diff_load_index(&index, repo)) < 0)
0 0 if (!index && (error = diff_load_index(&index, repo)) < 0)
1371 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 ||
1372 95 0 (error = git_iterator_for_tree(&a, old_tree, &a_opts)) < 0 ||
1373 95 0 (error = git_iterator_for_index(&b, repo, index, &b_opts)) < 0 ||
1378 0 95 if (index_ignore_case)
1405 116 0 assert(out && repo);
0 116 assert(out && repo);
1409 16 100 if (!index && (error = diff_load_index(&index, repo)) < 0)
0 16 if (!index && (error = diff_load_index(&index, repo)) < 0)
1412 116 0 if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, GIT_ITERATOR_INCLUDE_CONFLICTS,
1413 116 0 &b_opts, GIT_ITERATOR_DONT_AUTOEXPAND, opts)) < 0 ||
1414 116 0 (error = git_iterator_for_index(&a, repo, index, &a_opts)) < 0 ||
1415 116 0 (error = git_iterator_for_workdir(&b, repo, index, NULL, &b_opts)) < 0 ||
1419 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)
1420 0 0 if ((error = git_index_write(index)) < 0)
1448 2 0 assert(out && repo);
0 2 assert(out && repo);
1452 2 0 if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, 0,
1453 2 0 &b_opts, GIT_ITERATOR_DONT_AUTOEXPAND, opts) < 0) ||
1454 2 0 (error = git_repository_index__weakptr(&index, repo)) < 0 ||
1455 2 0 (error = git_iterator_for_tree(&a, old_tree, &a_opts)) < 0 ||
1456 2 0 (error = git_iterator_for_workdir(&b, repo, index, old_tree, &b_opts)) < 0 ||
1481 0 0 assert(out && repo);
0 0 assert(out && repo);
1485 0 0 if ((error = diff_load_index(&index, repo)) < 0)
1488 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)) &&
1494 0 0 if (error) {
1517 0 0 assert(out && old_index && new_index);
0 0 assert(out && old_index && new_index);
0 0 assert(out && old_index && new_index);
1521 0 0 if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, GIT_ITERATOR_DONT_IGNORE_CASE,
1522 0 0 &b_opts, GIT_ITERATOR_DONT_IGNORE_CASE, opts) < 0) ||
1523 0 0 (error = git_iterator_for_index(&a, repo, old_index, &a_opts)) < 0 ||
1524 0 0 (error = git_iterator_for_index(&b, repo, new_index, &b_opts)) < 0 ||
1529 0 0 if (old_index->ignore_case || new_index->ignore_case)
0 0 if (old_index->ignore_case || new_index->ignore_case)
1555 62 1 i_max = head2idx ? head2idx->deltas.length : 0;
1556 62 1 j_max = idx2wd ? idx2wd->deltas.length : 0;
1557 33 30 if (!i_max && !j_max)
21 12 if (!i_max && !j_max)
1573 41 1 h2i_icase = head2idx != NULL && git_diff_is_sorted_icase(head2idx);
0 41 h2i_icase = head2idx != NULL && git_diff_is_sorted_icase(head2idx);
1574 42 0 i2w_icase = idx2wd != NULL && git_diff_is_sorted_icase(idx2wd);
0 42 i2w_icase = idx2wd != NULL && git_diff_is_sorted_icase(idx2wd);
1577 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);
1579 0 42 if (icase_mismatch && h2i_icase) {
0 0 if (icase_mismatch && h2i_icase) {
1584 0 42 if (i2w_icase && !icase_mismatch) {
0 0 if (i2w_icase && !icase_mismatch) {
1589 42 0 } else if (idx2wd != NULL) {
1594 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; ) {
1595 65 1 h2i = head2idx ? GIT_VECTOR_GET(&head2idx->deltas, i) : NULL;
38 27 h2i = head2idx ? GIT_VECTOR_GET(&head2idx->deltas, i) : NULL;
1596 66 0 i2w = idx2wd ? GIT_VECTOR_GET(&idx2wd->deltas, j) : NULL;
49 17 i2w = idx2wd ? GIT_VECTOR_GET(&idx2wd->deltas, j) : NULL;
1598 49 17 cmp = !i2w ? -1 : !h2i ? 1 :
21 28 cmp = !i2w ? -1 : !h2i ? 1 :
1601 20 46 if (cmp < 0) {
1603 36 10 } else if (cmp > 0) {
1609 0 66 if ((error = cb(h2i, i2w, payload)) != 0) {
1616 0 42 if (icase_mismatch && h2i_icase) {
0 0 if (icase_mismatch && h2i_icase) {
1622 42 0 if (idx2wd != NULL) {
1623 0 42 git_vector_set_cmp(&idx2wd->deltas,
1645 0 3 if ((parents = git_commit_parentcount(commit)) > 1) {
1654 3 0 if (parents > 0)
1655 3 0 if ((error = git_commit_parent(&parent, commit, 0)) < 0 ||
3 0 if ((error = git_commit_parent(&parent, commit, 0)) < 0 ||
1659 3 0 if ((error = git_commit_tree(&new_tree, commit)) < 0 ||
3 0 if ((error = git_commit_tree(&new_tree, commit)) < 0 ||