Branch Coverage

deps/libgit2/src/transaction.c
Criterion Covered Total %
branch 55 132 41.6


line true false branch
60 0 0 assert(out && cfg);
0 0 assert(out && cfg);
63 0 0 GIT_ERROR_CHECK_ALLOC(tx);
77 3 0 assert(out && repo);
0 3 assert(out && repo);
79 0 3 if ((error = git_pool_init(&pool, 1)) < 0)
83 0 3 if (!tx) {
88 0 3 if ((error = git_strmap_new(&tx->locks)) < 0) {
93 0 3 if ((error = git_repository_refdb(&tx->db, repo)) < 0)
112 3 0 assert(tx && refname);
0 3 assert(tx && refname);
115 0 3 GIT_ERROR_CHECK_ALLOC(node);
118 0 3 GIT_ERROR_CHECK_ALLOC(node->name);
120 0 3 if ((error = git_refdb_lock(&node->payload, tx->db, refname)) < 0)
123 0 3 if ((error = git_strmap_set(tx->locks, node->name, node)) < 0)
138 0 6 if ((node = git_strmap_get(tx->locks, refname)) == NULL) {
149 0 2 if (sig && git_signature__pdup(&node->sig, sig, &tx->pool) < 0)
0 0 if (sig && git_signature__pdup(&node->sig, sig, &tx->pool) < 0)
152 2 0 if (!node->sig) {
156 0 2 if (git_reference__log_signature(&tmp, tx->repo) < 0)
162 0 2 if (error < 0)
166 0 2 if (msg) {
168 0 0 GIT_ERROR_CHECK_ALLOC(node->message);
179 2 0 assert(tx && refname && target);
2 0 assert(tx && refname && target);
0 2 assert(tx && refname && target);
181 0 2 if ((error = find_locked(&node, tx, refname)) < 0)
184 0 2 if ((error = copy_common(node, tx, sig, msg)) < 0)
198 0 0 assert(tx && refname && target);
0 0 assert(tx && refname && target);
0 0 assert(tx && refname && target);
200 0 0 if ((error = find_locked(&node, tx, refname)) < 0)
203 0 0 if ((error = copy_common(node, tx, sig, msg)) < 0)
207 0 0 GIT_ERROR_CHECK_ALLOC(node->target.symbolic);
218 0 1 if ((error = find_locked(&node, tx, refname)) < 0)
234 0 3 GIT_ERROR_CHECK_ALLOC(reflog);
237 0 3 GIT_ERROR_CHECK_ALLOC(reflog->ref_name);
242 0 3 GIT_ERROR_CHECK_ALLOC(reflog->entries.contents);
245 0 3 GIT_ERROR_CHECK_ALLOC(entries);
247 2 3 for (i = 0; i < len; i++) {
259 0 2 GIT_ERROR_CHECK_ALLOC(tgt->msg);
261 0 2 if (git_signature__pdup(&tgt->committer, src->committer, pool) < 0)
275 3 0 assert(tx && refname && reflog);
3 0 assert(tx && refname && reflog);
0 3 assert(tx && refname && reflog);
277 0 3 if ((error = find_locked(&node, tx, refname)) < 0)
280 0 3 if ((error = dup_reflog(&node->reflog, reflog, &tx->pool)) < 0)
291 3 0 if (node->ref_type == GIT_REFERENCE_DIRECT) {
293 0 0 } else if (node->ref_type == GIT_REFERENCE_SYMBOLIC) {
299 0 3 GIT_ERROR_CHECK_ALLOC(ref);
302 1 2 if (node->remove) {
304 2 0 } else if (node->ref_type == GIT_REFERENCE_DIRECT) {
306 0 0 } else if (node->ref_type == GIT_REFERENCE_SYMBOLIC) {
323 0 3 assert(tx);
325 0 3 if (tx->type == TRANSACTION_CONFIG) {
332 3 0 git_strmap_foreach_value(tx->locks, node, {
0 3 git_strmap_foreach_value(tx->locks, node, {
0 3 git_strmap_foreach_value(tx->locks, node, {
0 0 git_strmap_foreach_value(tx->locks, node, {
0 3 git_strmap_foreach_value(tx->locks, node, {
3 3 git_strmap_foreach_value(tx->locks, node, {
358 0 3 assert(tx);
360 0 3 if (tx->type == TRANSACTION_CONFIG) {
361 0 0 if (tx->cfg) {
371 3 0 git_strmap_foreach_value(tx->locks, node, {
3 3 git_strmap_foreach_value(tx->locks, node, {