Branch Coverage

deps/libgit2/src/libgit2/diff_generate.c
Criterion Covered Total %
branch 344 688 50.0


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 677 0 if ((S_ISLNK(entry->mode) || S_ISREG(entry->mode)) &&
666 11 if ((S_ISLNK(entry->mode) || S_ISREG(entry->mode)) &&
39 627 if ((S_ISLNK(entry->mode) || S_ISREG(entry->mode)) &&
128 434 152 if (file->size ||
434 0 if (file->size ||
129 12 422 !(file->flags & GIT_DIFF_FLAG_VALID_ID) ||
151 0 281 GIT_ASSERT_ARG((oitem != NULL) ^ (nitem != NULL));
153 21 260 if (oitem) {
158 1 280 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE))
161 0 281 if ((entry->flags & GIT_INDEX_ENTRY_VALID) != 0)
164 9 272 if (status == GIT_DELTA_IGNORED &&
3 6 if (status == GIT_DELTA_IGNORED &&
168 202 76 if (status == GIT_DELTA_UNTRACKED &&
136 66 if (status == GIT_DELTA_UNTRACKED &&
172 0 142 if (status == GIT_DELTA_UNREADABLE &&
0 0 if (status == GIT_DELTA_UNREADABLE &&
176 0 142 if (!diff_pathspec_match(&matched_pathspec, diff, entry))
180 0 142 GIT_ERROR_CHECK_ALLOC(delta);
183 0 142 GIT_ASSERT(status != GIT_DELTA_MODIFIED);
186 22 120 if (has_old) {
202 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))
224 470 63 if (status == GIT_DELTA_UNMODIFIED &&
382 88 if (status == GIT_DELTA_UNMODIFIED &&
228 139 12 if (!new_id)
231 1 150 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE)) {
245 0 151 GIT_ERROR_CHECK_ALLOC(delta);
248 151 0 if (!git_index_entry_is_conflict(old_entry)) {
257 151 0 if (!git_index_entry_is_conflict(new_entry)) {
265 132 19 if (!git_oid_is_zero(&new_entry->id))
279 29 12 if (!delta)
285 0 0 if (git_oid__cmp(&delta->old_file.id, &item->id) == 0)
289 0 0 if (git_oid__cmp(&delta->new_file.id, &item->id) == 0)
299 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 ||
300 0 0 (delta->new_file.mode == item->mode &&
316 596 0 if (len > 0 && prefix[len - 1] != '/')
6 590 if (len > 0 && prefix[len - 1] != '/')
324 40 0 return delta->old_file.path ?
332 0 20 return val ? val : ((int)da->status - (int)db->status);
339 0 0 return val ? val : ((int)da->status - (int)db->status);
345 108 0 uint32_t flags = opts ? opts->flags : 0;
347 0 108 if (delta->status == GIT_DELTA_UNMODIFIED &&
0 0 if (delta->status == GIT_DELTA_UNMODIFIED &&
351 2 106 if (delta->status == GIT_DELTA_IGNORED &&
0 2 if (delta->status == GIT_DELTA_IGNORED &&
355 38 70 if (delta->status == GIT_DELTA_UNTRACKED &&
0 38 if (delta->status == GIT_DELTA_UNTRACKED &&
359 0 108 if (delta->status == GIT_DELTA_UNREADABLE &&
0 0 if (delta->status == GIT_DELTA_UNREADABLE &&
377 0 0 case GIT_ITERATOR_FS: pfx = left_side ? "1" : "2"; break;
390 298 0 if (!ignore_case) {
435 0 298 GIT_ASSERT_ARG_WITH_RETVAL(repo, NULL);
436 0 298 GIT_ASSERT_ARG_WITH_RETVAL(old_iter, NULL);
437 0 298 GIT_ASSERT_ARG_WITH_RETVAL(new_iter, NULL);
439 0 298 if ((diff = git__calloc(1, sizeof(git_diff_generated))) == NULL)
477 294 4 if (opts) {
481 0 294 DIFF_FLAG_SET(diff, GIT_DIFF_IGNORE_CASE, icase);
484 0 294 if (git_pathspec__vinit(&diff->pathspec, &opts->pathspec, pool) < 0)
489 53 245 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_TYPECHANGE_TREES))
493 0 298 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_SHOW_UNTRACKED_CONTENT))
497 0 298 if ((val = git_repository_config_snapshot(&cfg, repo)) < 0)
500 298 0 if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_SYMLINKS) && val)
298 0 if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_SYMLINKS) && val)
503 298 0 if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_IGNORESTAT) && val)
0 298 if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_IGNORESTAT) && val)
507 298 0 !git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_FILEMODE) && val)
510 298 0 if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_TRUSTCTIME) && val)
298 0 if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_TRUSTCTIME) && val)
516 4 294 if (!opts) {
518 4 0 diff->base.opts.context_lines = context >= 0 ? (uint32_t)context : 3;
524 2 296 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE)) {
531 0 298 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) &&
0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) &&
532 0 0 (!(diff->base.old_src == GIT_ITERATOR_WORKDIR ||
533 0 0 diff->base.new_src == GIT_ITERATOR_WORKDIR) ||
534 0 0 !(diff->base.old_src == GIT_ITERATOR_INDEX ||
539 280 18 if (diff->base.opts.ignore_submodules <= 0) {
543 0 280 if (entry && git_submodule_parse_ignore(
0 0 if (entry && git_submodule_parse_ignore(
550 3 295 if (!diff->base.opts.old_prefix || !diff->base.opts.new_prefix) {
0 3 if (!diff->base.opts.old_prefix || !diff->base.opts.new_prefix) {
554 0 295 if (git_config__get_bool_force(cfg, "diff.noprefix", 0))
556 0 295 else if (git_config__get_bool_force(cfg, "diff.mnemonicprefix", 0)) {
561 295 0 if (!diff->base.opts.old_prefix)
563 295 0 if (!diff->base.opts.new_prefix)
571 2 296 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE)) {
580 298 0 return (!diff->base.opts.old_prefix || !diff->base.opts.new_prefix) ? -1 : 0;
0 298 return (!diff->base.opts.old_prefix || !diff->base.opts.new_prefix) ? -1 : 0;
592 0 1 if (size > UINT32_MAX) {
618 0 156 GIT_ASSERT(d->type == GIT_DIFF_TYPE_GENERATED);
623 0 156 if (git_repository_workdir_path(&full_path, diff->base.repo, entry.path) < 0)
626 0 156 if (!mode) {
631 0 0 if (p_stat(full_path.ptr, &st) < 0) {
642 0 156 if (S_ISGITLINK(mode)) {
645 0 0 if (!git_submodule_lookup(&sm, diff->base.repo, entry.path)) {
647 0 0 if (sm_oid)
656 0 156 } else if (S_ISLNK(mode)) {
659 0 156 } else if (!git__is_sizet(entry.file_size)) {
663 156 0 } else if (!(error = git_filter_list_load(&fl,
668 0 156 if (fd < 0)
681 156 0 if (!error && update_match && git_oid_equal(out, update_match)) {
0 156 if (!error && update_match && git_oid_equal(out, update_match)) {
0 0 if (!error && update_match && git_oid_equal(out, update_match)) {
689 0 0 if (!(error = git_repository_index__weakptr(&idx,
726 0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_SUBMODULES) ||
0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_SUBMODULES) ||
730 0 0 if (diff->base.repo->submodule_cache != NULL) {
733 0 0 if (!info->submodule_cache_initialized) {
745 0 0 if ((error = git_submodule__lookup_with_cache(
749 0 0 if (error == GIT_EEXISTS) {
756 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)
758 0 0 else if ((error = git_submodule__status(
765 0 0 else if (!GIT_SUBMODULE_STATUS_IS_WD_UNMODIFIED(sm_status))
792 2 533 if (!diff_pathspec_match(&matched_pathspec, diff, oitem))
798 0 533 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 &&
803 0 533 if (!(diff->diffcaps & GIT_DIFFCAPS_TRUST_MODE_BITS) &&
0 0 if (!(diff->diffcaps & GIT_DIFFCAPS_TRUST_MODE_BITS) &&
804 0 0 (nmode & MODE_BITS_MASK) != (omode & MODE_BITS_MASK) &&
814 0 533 } else if ((oitem->flags & GIT_INDEX_ENTRY_VALID) != 0) {
818 0 533 } else if ((oitem->flags_extended & GIT_INDEX_ENTRY_SKIP_WORKTREE) != 0) {
822 0 533 } else if (GIT_MODE_TYPE(omode) != GIT_MODE_TYPE(nmode)) {
823 0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_TYPECHANGE)) {
827 0 0 else if (nmode == GIT_FILEMODE_UNREADABLE) {
828 0 0 if (!(error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem, NULL)))
834 0 0 if (!(error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem, NULL)))
840 289 244 } else if (git_oid_equal(&oitem->id, &nitem->id) &&
289 0 } else if (git_oid_equal(&oitem->id, &nitem->id) &&
841 289 0 omode == nmode &&
848 200 44 } else if (git_oid_is_zero(&nitem->id) && new_is_workdir) {
200 0 } else if (git_oid_is_zero(&nitem->id) && new_is_workdir) {
855 0 200 if (S_ISGITLINK(nmode)) {
856 0 0 if ((error = maybe_modified_submodule(&status, &noid, diff, info)) < 0)
863 200 0 else if (omode != nmode || oitem->file_size != nitem->file_size) {
26 174 else if (omode != nmode || oitem->file_size != nitem->file_size) {
866 19 7 (oitem->file_size <= 0 && nitem->file_size > 0);
19 0 (oitem->file_size <= 0 && nitem->file_size > 0);
868 174 0 else if (!git_index_time_eq(&oitem->mtime, &nitem->mtime) ||
174 0 else if (!git_index_time_eq(&oitem->mtime, &nitem->mtime) ||
869 174 0 (use_ctime && !git_index_time_eq(&oitem->ctime, &nitem->ctime)) ||
174 0 (use_ctime && !git_index_time_eq(&oitem->ctime, &nitem->ctime)) ||
870 174 0 oitem->ino != nitem->ino ||
871 174 0 oitem->uid != nitem->uid ||
872 91 83 oitem->gid != nitem->gid ||
880 0 44 } else if (S_ISGITLINK(nmode) &&
0 0 } else if (S_ISGITLINK(nmode) &&
888 110 423 if (modified_uncertain && git_oid_is_zero(&nitem->id)) {
110 0 if (modified_uncertain && git_oid_is_zero(&nitem->id)) {
890 0 0 DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) && omode == nmode ?
891 0 110 &oitem->id : NULL;
893 0 110 if ((error = git_diff__oid_for_entry(
901 110 0 if (omode == nmode && !S_ISGITLINK(omode) &&
910 0 533 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE) &&
0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE) &&
911 0 0 DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_CASECHANGE) &&
914 0 0 if (!(error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem, NULL)))
920 110 423 return diff_delta__from_two(
932 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)
937 2 0 return (prefix_item->path[pathlen - 1] == '/' ||
938 2 108 item->path[pathlen] == '\0' ||
0 2 item->path[pathlen] == '\0' ||
948 50 546 if ((error = git_iterator_current(entry, iterator)) == GIT_ITEROVER) {
968 795 545 while ((error = git_iterator_advance(entry, iterator)) == 0) {
970 0 0 !git_index_entry_is_conflict(prev_entry) ||
975 0 0 strcasecmp(prev_entry->path, (*entry)->path) :
978 0 0 if (cmp)
982 545 795 if (error == GIT_ITEROVER) {
996 0 114 if ((error = git_iterator_advance_into(entry, iterator)) == GIT_ITEROVER) {
1011 1 10 if (error == GIT_ITEROVER) {
1031 0 374 if (git_index_entry_is_conflict(nitem))
1035 9 365 else if (git_iterator_current_is_ignored(info->new_iter))
1038 155 219 if (nitem->mode == GIT_FILEMODE_TREE) {
1042 47 0 recurse_into_dir = contains_oitem ||
1043 41 6 (delta_type == GIT_DELTA_UNTRACKED &&
1044 47 108 DIFF_FLAG_IS_SET(diff, GIT_DIFF_RECURSE_UNTRACKED_DIRS)) ||
0 41 DIFF_FLAG_IS_SET(diff, GIT_DIFF_RECURSE_UNTRACKED_DIRS)) ||
1045 0 0 (delta_type == GIT_DELTA_IGNORED &&
1049 114 41 if (recurse_into_dir && !contains_oitem) {
6 108 if (recurse_into_dir && !contains_oitem) {
1051 0 6 if (git_iterator_current_workdir_path(&full, info->new_iter) < 0)
1053 6 0 if (full && git_fs_path_contains(full, DOT_GIT)) {
0 6 if (full && git_fs_path_contains(full, DOT_GIT)) {
1062 41 114 if (!recurse_into_dir &&
41 0 if (!recurse_into_dir &&
1063 41 0 delta_type == GIT_DELTA_UNTRACKED &&
1070 0 41 if ((error = diff_delta__from_one(diff, delta_type, NULL, nitem)) != 0)
1075 30 11 if (!last)
1079 0 11 if ((error = iterator_advance_over(
1084 0 11 if (untracked_state == GIT_ITERATOR_STATUS_FILTERED) {
1090 11 0 if (untracked_state == GIT_ITERATOR_STATUS_IGNORED ||
1 10 if (untracked_state == GIT_ITERATOR_STATUS_IGNORED ||
1095 0 1 if (DIFF_FLAG_ISNT_SET(diff, GIT_DIFF_INCLUDE_IGNORED)) {
1105 114 0 if (recurse_into_dir) {
1109 0 114 if (error == GIT_ENOTFOUND) {
1118 9 210 else if (delta_type == GIT_DELTA_IGNORED &&
7 2 else if (delta_type == GIT_DELTA_IGNORED &&
1119 0 7 DIFF_FLAG_ISNT_SET(diff, GIT_DIFF_RECURSE_IGNORED_DIRS) &&
1124 49 170 else if (info->new_iter->type != GIT_ITERATOR_WORKDIR) {
1125 49 0 if (delta_type != GIT_DELTA_CONFLICTED)
1129 0 170 else if (nitem->mode == GIT_FILEMODE_COMMIT) {
1131 0 0 if (git_submodule_lookup(NULL, info->repo, nitem->path) != 0) {
1136 0 0 if (contains_oitem) {
1138 0 0 if (error != GIT_ENOTFOUND)
1147 0 170 else if (nitem->mode == GIT_FILEMODE_UNREADABLE) {
1148 0 0 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED))
1155 0 219 if ((error = diff_delta__from_one(diff, delta_type, NULL, nitem)) != 0)
1161 210 9 if (delta_type != GIT_DELTA_IGNORED &&
7 203 if (delta_type != GIT_DELTA_IGNORED &&
1162 0 7 DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_TYPECHANGE_TREES) &&
1167 0 0 if (last) {
1183 0 21 if (git_index_entry_is_conflict(info->oitem))
1186 0 21 if ((error = diff_delta__from_one(diff, delta_type, info->oitem, NULL)) < 0)
1197 0 0 if (last) {
1206 0 0 if (S_ISDIR(info->nitem->mode) &&
0 0 if (S_ISDIR(info->nitem->mode) &&
1219 0 535 if ((error = maybe_modified(diff, info)) < 0)
1222 535 0 if (!(error = iterator_advance(&info->oitem, info->old_iter)))
1242 0 298 GIT_ERROR_CHECK_ALLOC(diff);
1249 0 298 if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE)) {
1250 0 0 if ((error = git_iterator_set_ignore_case(old_iter, true)) < 0 ||
0 0 if ((error = git_iterator_set_ignore_case(old_iter, true)) < 0 ||
1256 0 298 if ((error = diff_generated_apply_options(diff, opts)) < 0)
1259 298 0 if ((error = iterator_current(&info.oitem, old_iter)) < 0 ||
298 0 if ((error = iterator_current(&info.oitem, old_iter)) < 0 ||
1264 1228 0 while (!error && (info.oitem || info.nitem)) {
832 396 while (!error && (info.oitem || info.nitem)) {
98 298 while (!error && (info.oitem || info.nitem)) {
1268 921 9 if (opts && opts->progress_cb) {
0 921 if (opts && opts->progress_cb) {
1269 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,
1277 832 98 (info.nitem ? diff->base.entrycomp(info.oitem, info.nitem) : -1) : 1;
822 10 (info.nitem ? diff->base.entrycomp(info.oitem, info.nitem) : -1) : 1;
1280 21 909 if (cmp < 0)
1286 374 535 else if (cmp > 0)
1300 298 0 if (!error)
1304 0 298 if (info.submodule_cache)
1314 0 227 GIT_ERROR_CHECK_VERSION(opts, GIT_DIFF_OPTIONS_VERSION, "git_diff_options");
1318 223 4 if (opts && (opts->flags & GIT_DIFF_DISABLE_PATHSPEC_MATCH)) {
36 187 if (opts && (opts->flags & GIT_DIFF_DISABLE_PATHSPEC_MATCH)) {
1323 187 4 } else if (opts) {
1325 0 187 GIT_ERROR_CHECK_ALLOC(prefix);
1351 0 18 GIT_ASSERT_ARG(out);
1352 0 18 GIT_ASSERT_ARG(repo);
1360 18 0 if (opts && (opts->flags & GIT_DIFF_IGNORE_CASE) != 0)
0 18 if (opts && (opts->flags & GIT_DIFF_IGNORE_CASE) != 0)
1363 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 ||
1364 18 0 (error = git_iterator_for_tree(&a, old_tree, &a_opts)) < 0 ||
1365 18 0 (error = git_iterator_for_tree(&b, new_tree, &b_opts)) < 0 ||
1385 16 0 if (!error && git_index_read(*index, false) < 0)
0 16 if (!error && git_index_read(*index, false) < 0)
1408 0 95 GIT_ASSERT_ARG(out);
1409 0 95 GIT_ASSERT_ARG(repo);
1413 0 95 if (!index && (error = diff_load_index(&index, repo)) < 0)
0 0 if (!index && (error = diff_load_index(&index, repo)) < 0)
1418 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 ||
1419 95 0 (error = git_iterator_for_tree(&a, old_tree, &a_opts)) < 0 ||
1420 95 0 (error = git_iterator_for_index(&b, repo, index, &b_opts)) < 0 ||
1425 0 95 if (index_ignore_case)
1452 0 112 GIT_ASSERT_ARG(out);
1453 0 112 GIT_ASSERT_ARG(repo);
1457 16 96 if (!index && (error = diff_load_index(&index, repo)) < 0)
0 16 if (!index && (error = diff_load_index(&index, repo)) < 0)
1460 112 0 if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, GIT_ITERATOR_INCLUDE_CONFLICTS,
1461 112 0 &b_opts, GIT_ITERATOR_DONT_AUTOEXPAND, opts)) < 0 ||
1462 112 0 (error = git_iterator_for_index(&a, repo, index, &a_opts)) < 0 ||
1463 112 0 (error = git_iterator_for_workdir(&b, repo, index, NULL, &b_opts)) < 0 ||
1467 0 112 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)
1468 0 0 if ((error = git_index_write(index)) < 0)
1496 0 2 GIT_ASSERT_ARG(out);
1497 0 2 GIT_ASSERT_ARG(repo);
1501 2 0 if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, 0,
1502 2 0 &b_opts, GIT_ITERATOR_DONT_AUTOEXPAND, opts) < 0) ||
1503 2 0 (error = git_repository_index__weakptr(&index, repo)) < 0 ||
1504 2 0 (error = git_iterator_for_tree(&a, old_tree, &a_opts)) < 0 ||
1505 2 0 (error = git_iterator_for_workdir(&b, repo, index, old_tree, &b_opts)) < 0 ||
1530 0 0 GIT_ASSERT_ARG(out);
1531 0 0 GIT_ASSERT_ARG(repo);
1535 0 0 if ((error = diff_load_index(&index, repo)) < 0)
1538 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)) &&
1544 0 0 if (error) {
1567 0 0 GIT_ASSERT_ARG(out);
1568 0 0 GIT_ASSERT_ARG(old_index);
1569 0 0 GIT_ASSERT_ARG(new_index);
1573 0 0 if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, GIT_ITERATOR_DONT_IGNORE_CASE,
1574 0 0 &b_opts, GIT_ITERATOR_DONT_IGNORE_CASE, opts) < 0) ||
1575 0 0 (error = git_iterator_for_index(&a, repo, old_index, &a_opts)) < 0 ||
1576 0 0 (error = git_iterator_for_index(&b, repo, new_index, &b_opts)) < 0 ||
1581 0 0 if (old_index->ignore_case || new_index->ignore_case)
0 0 if (old_index->ignore_case || new_index->ignore_case)
1607 62 1 i_max = head2idx ? head2idx->deltas.length : 0;
1608 62 1 j_max = idx2wd ? idx2wd->deltas.length : 0;
1609 33 30 if (!i_max && !j_max)
21 12 if (!i_max && !j_max)
1625 41 1 h2i_icase = head2idx != NULL && git_diff_is_sorted_icase(head2idx);
0 41 h2i_icase = head2idx != NULL && git_diff_is_sorted_icase(head2idx);
1626 42 0 i2w_icase = idx2wd != NULL && git_diff_is_sorted_icase(idx2wd);
0 42 i2w_icase = idx2wd != NULL && git_diff_is_sorted_icase(idx2wd);
1629 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);
1631 0 42 if (icase_mismatch && h2i_icase) {
0 0 if (icase_mismatch && h2i_icase) {
1636 0 42 if (i2w_icase && !icase_mismatch) {
0 0 if (i2w_icase && !icase_mismatch) {
1641 42 0 } else if (idx2wd != NULL) {
1646 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; ) {
1647 65 1 h2i = head2idx ? GIT_VECTOR_GET(&head2idx->deltas, i) : NULL;
38 27 h2i = head2idx ? GIT_VECTOR_GET(&head2idx->deltas, i) : NULL;
1648 66 0 i2w = idx2wd ? GIT_VECTOR_GET(&idx2wd->deltas, j) : NULL;
49 17 i2w = idx2wd ? GIT_VECTOR_GET(&idx2wd->deltas, j) : NULL;
1650 49 17 cmp = !i2w ? -1 : !h2i ? 1 :
21 28 cmp = !i2w ? -1 : !h2i ? 1 :
1653 20 46 if (cmp < 0) {
1655 36 10 } else if (cmp > 0) {
1661 0 66 if ((error = cb(h2i, i2w, payload)) != 0) {
1668 0 42 if (icase_mismatch && h2i_icase) {
0 0 if (icase_mismatch && h2i_icase) {
1674 42 0 if (idx2wd != NULL) {
1675 0 42 git_vector_set_cmp(&idx2wd->deltas,
1697 0 3 if ((parents = git_commit_parentcount(commit)) > 1) {
1706 3 0 if (parents > 0)
1707 3 0 if ((error = git_commit_parent(&parent, commit, 0)) < 0 ||
3 0 if ((error = git_commit_parent(&parent, commit, 0)) < 0 ||
1711 3 0 if ((error = git_commit_tree(&new_tree, commit)) < 0 ||
3 0 if ((error = git_commit_tree(&new_tree, commit)) < 0 ||