Branch Coverage

deps/libgit2/src/diff_file.c
Criterion Covered Total %
branch 68 134 50.7


line true false branch
23 89 60 if ((fc->file->flags & DIFF_FLAGS_KNOWN_BINARY) == 0 &&
89 0 if ((fc->file->flags & DIFF_FLAGS_KNOWN_BINARY) == 0 &&
24 0 89 fc->opts_max_size > 0 &&
33 40 60 if ((fc->file->flags & DIFF_FLAGS_KNOWN_BINARY) != 0)
47 100 0 fc->opts_flags = opts ? opts->flags : GIT_DIFF_NORMAL;
49 100 0 if (opts && opts->max_size >= 0)
100 0 if (opts && opts->max_size >= 0)
50 0 100 fc->opts_max_size = opts->max_size ?
53 2 98 if (fc->src == GIT_ITERATOR_EMPTY)
68 0 100 else if (fc->opts_flags & GIT_DIFF_FORCE_TEXT) {
73 4 96 else if (fc->opts_flags & GIT_DIFF_FORCE_BINARY) {
80 47 53 if ((fc->flags & GIT_DIFF_FLAG__NO_DATA) != 0) {
86 49 51 if ((fc->flags & GIT_DIFF_FLAG__LOADED) != 0)
102 49 49 fc->file = use_old ? &delta->old_file : &delta->new_file;
103 49 49 fc->src = use_old ? diff->old_src : diff->new_src;
105 0 98 if (git_diff_driver_lookup(&fc->driver, fc->repo,
115 7 7 has_data = !use_old &&
0 7 has_data = !use_old &&
128 47 51 if (!has_data)
145 1 1 if (!src->blob && !src->buf) {
0 1 if (!src->blob && !src->buf) {
152 1 1 if (src->blob) {
182 0 0 if (check_status) {
188 0 0 if ((error = git_submodule_lookup(&sm, fc->repo, fc->file->path)) < 0) {
190 0 0 if (error == GIT_EEXISTS) {
197 0 0 if ((error = git_submodule_status(&sm_status, fc->repo, fc->file->path, GIT_SUBMODULE_IGNORE_UNSPECIFIED)) < 0) {
203 0 0 if ((fc->file->flags & GIT_DIFF_FLAG_VALID_ID) == 0 &&
0 0 if ((fc->file->flags & GIT_DIFF_FLAG_VALID_ID) == 0 &&
204 0 0 ((sm_head = git_submodule_wd_id(sm)) != NULL ||
211 0 0 if (GIT_SUBMODULE_STATUS_IS_WD_DIRTY(sm_status))
218 0 0 if (git_buf_printf(&content, "Subproject commit %s%s\n", oid, status) < 0)
235 0 47 if (git_oid_is_zero(&fc->file->id))
238 0 47 if (fc->file->mode == GIT_FILEMODE_COMMIT)
242 13 34 if (!fc->file->size) {
243 0 13 if ((error = git_diff_file__resolve_zero_size(
252 0 47 if (odb_obj != NULL) {
261 47 0 if (!error) {
276 0 0 if ((error = git_futils_readbuffer(&target, path->ptr)) < 0)
293 0 0 if ((error = git_repository__configmap_lookup(
297 0 0 if (!symlink_supported)
306 0 0 GIT_ERROR_CHECK_ALLOC(fc->map.data);
311 0 0 if (read_len < 0) {
330 0 4 if (fd < 0)
333 0 4 if (!fc->file->size)
336 4 0 if (error < 0 || !fc->file->size)
4 0 if (error < 0 || !fc->file->size)
343 0 4 if ((error = git_filter_list_load(
349 4 0 if (fl == NULL) {
350 4 0 if (!(error = git_futils_mmap_ro(
360 0 0 if (!(error = git_futils_readbuffer_fd(&raw, fd, (size_t)fc->file->size))) {
365 0 0 if (out.ptr != raw.ptr)
368 0 0 if (!error) {
389 0 4 if (fc->file->mode == GIT_FILEMODE_COMMIT)
392 0 4 if (fc->file->mode == GIT_FILEMODE_TREE)
395 0 4 if (git_buf_joinpath(
399 0 4 if (S_ISLNK(fc->file->mode))
405 4 0 if (!error && (fc->file->flags & GIT_DIFF_FLAG_VALID_ID) == 0) {
4 0 if (!error && (fc->file->flags & GIT_DIFF_FLAG_VALID_ID) == 0) {
421 49 51 if ((fc->flags & GIT_DIFF_FLAG__LOADED) != 0)
424 2 49 if ((fc->file->flags & GIT_DIFF_FLAG_BINARY) != 0 &&
0 2 if ((fc->file->flags & GIT_DIFF_FLAG_BINARY) != 0 &&
428 4 47 if (fc->src == GIT_ITERATOR_WORKDIR)
432 0 51 if (error)
444 0 100 if ((fc->flags & GIT_DIFF_FLAG__LOADED) == 0)
447 0 100 if (fc->flags & GIT_DIFF_FLAG__FREE_DATA) {
453 4 96 else if (fc->flags & GIT_DIFF_FLAG__UNMAP_DATA) {
460 48 52 if (fc->flags & GIT_DIFF_FLAG__FREE_BLOB) {