Branch Coverage

deps/libgit2/src/cherrypick.c
Criterion Covered Total %
branch 42 86 48.8


line true false branch
32 6 0 if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_CHERRYPICK_HEAD_FILE)) >= 0 &&
6 0 if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_CHERRYPICK_HEAD_FILE)) >= 0 &&
33 6 0 (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_CREATE_LEADING_DIRS, GIT_CHERRYPICK_FILE_MODE)) >= 0 &&
37 0 6 if (error < 0)
53 6 0 if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_MERGE_MSG_FILE)) < 0 ||
6 0 if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_MERGE_MSG_FILE)) < 0 ||
54 6 0 (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_CREATE_LEADING_DIRS, GIT_CHERRYPICK_FILE_MODE)) < 0 ||
61 0 6 if (error < 0)
81 6 0 if (given != NULL)
88 0 6 if (!opts->checkout_opts.checkout_strategy)
91 6 0 if (!opts->checkout_opts.our_label)
94 6 0 if (!opts->checkout_opts.their_label)
129 6 0 assert(out && repo && cherrypick_commit && our_commit);
6 0 assert(out && repo && cherrypick_commit && our_commit);
6 0 assert(out && repo && cherrypick_commit && our_commit);
0 6 assert(out && repo && cherrypick_commit && our_commit);
131 0 6 if (git_commit_parentcount(cherrypick_commit) > 1) {
132 0 0 if (!mainline)
138 0 6 if (mainline)
145 6 0 if (parent &&
6 0 if (parent &&
146 6 0 ((error = git_commit_parent(&parent_commit, cherrypick_commit, (parent - 1))) < 0 ||
150 6 0 if ((error = git_commit_tree(&cherrypick_tree, cherrypick_commit)) < 0 ||
6 0 if ((error = git_commit_tree(&cherrypick_tree, cherrypick_commit)) < 0 ||
180 6 0 assert(repo && commit);
0 6 assert(repo && commit);
182 0 6 GIT_ERROR_CHECK_VERSION(given_opts, GIT_CHERRYPICK_OPTIONS_VERSION, "git_cherrypick_options");
184 0 6 if ((error = git_repository__ensure_not_bare(repo, "cherry-pick")) < 0)
187 6 0 if ((commit_msg = git_commit_message(commit)) == NULL ||
0 6 if ((commit_msg = git_commit_message(commit)) == NULL ||
195 6 0 if ((error = write_merge_msg(repo, commit_msg)) < 0 ||
6 0 if ((error = write_merge_msg(repo, commit_msg)) < 0 ||
196 6 0 (error = git_buf_printf(&their_label, "%.7s... %s", commit_oidstr, commit_summary)) < 0 ||
197 6 0 (error = cherrypick_normalize_opts(repo, &opts, given_opts, git_buf_cstr(&their_label))) < 0 ||
198 6 0 (error = git_indexwriter_init_for_operation(&indexwriter, repo, &opts.checkout_opts.checkout_strategy)) < 0 ||
199 6 0 (error = write_cherrypick_head(repo, commit_oidstr)) < 0 ||
200 6 0 (error = git_repository_head(&our_ref, repo)) < 0 ||
201 6 0 (error = git_reference_peel((git_object **)&our_commit, our_ref, GIT_OBJECT_COMMIT)) < 0 ||
202 5 1 (error = git_cherrypick_commit(&index, repo, commit, our_commit, opts.mainline, &opts.merge_opts)) < 0 ||
203 5 0 (error = git_merge__check_result(repo, index)) < 0 ||
204 5 0 (error = git_merge__append_conflicts_to_merge_msg(repo, index)) < 0 ||
205 5 0 (error = git_checkout_index(repo, index, &opts.checkout_opts)) < 0 ||
227 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(