Branch Coverage

deps/libgit2/src/libgit2/fetchhead.c
Criterion Covered Total %
branch 0 112 0.0


line true false branch
25 0 0 if (one->is_merge && !two->is_merge)
0 0 if (one->is_merge && !two->is_merge)
27 0 0 if (two->is_merge && !one->is_merge)
0 0 if (two->is_merge && !one->is_merge)
30 0 0 if (one->ref_name && two->ref_name)
0 0 if (one->ref_name && two->ref_name)
32 0 0 else if (one->ref_name)
34 0 0 else if (two->ref_name)
46 0 0 if (git_net_url_parse(&url, remote_url) == 0) {
53 0 0 if ((error = git_net_url_fmt(&buf, &url)) < 0)
60 0 0 if (!sanitized)
76 0 0 GIT_ASSERT_ARG(out);
77 0 0 GIT_ASSERT_ARG(oid);
82 0 0 GIT_ERROR_CHECK_ALLOC(fetchhead_ref);
89 0 0 if (ref_name) {
91 0 0 GIT_ERROR_CHECK_ALLOC(fetchhead_ref->ref_name);
94 0 0 if (remote_url) {
96 0 0 GIT_ERROR_CHECK_ALLOC(fetchhead_ref->remote_url);
112 0 0 GIT_ASSERT_ARG(file);
113 0 0 GIT_ASSERT_ARG(fetchhead_ref);
118 0 0 if (git__prefixcmp(fetchhead_ref->ref_name, GIT_REFS_HEADS_DIR) == 0) {
121 0 0 } else if(git__prefixcmp(fetchhead_ref->ref_name,
125 0 0 } else if (!git__strcmp(fetchhead_ref->ref_name, GIT_HEAD_FILE)) {
132 0 0 if (head)
135 0 0 return git_filebuf_printf(file, "%s\t%s\t%s'%s' of %s\n",
150 0 0 GIT_ASSERT_ARG(repo);
151 0 0 GIT_ASSERT_ARG(fetchhead_refs);
153 0 0 if (git_str_joinpath(&path, repo->gitdir, GIT_FETCH_HEAD_FILE) < 0)
156 0 0 if (git_filebuf_open(&file, path.ptr, GIT_FILEBUF_APPEND, GIT_REFS_FILE_MODE) < 0) {
165 0 0 git_vector_foreach(fetchhead_refs, i, fetchhead_ref)
185 0 0 if (!*line) {
192 0 0 if ((oid_str = git__strsep(&line, "\t")) == NULL) {
199 0 0 if (strlen(oid_str) != GIT_OID_HEXSZ) {
205 0 0 if (git_oid_fromstr(oid, oid_str) < 0) {
207 0 0 const char *err_msg = oid_err ? oid_err->message : "invalid object ID";
215 0 0 if (*line) {
216 0 0 if ((is_merge_str = git__strsep(&line, "\t")) == NULL) {
222 0 0 if (*is_merge_str == '\0')
224 0 0 else if (strcmp(is_merge_str, "not-for-merge") == 0)
232 0 0 if ((desc = line) == NULL) {
238 0 0 if (git__prefixcmp(desc, "branch '") == 0) {
241 0 0 } else if (git__prefixcmp(desc, "tag '") == 0) {
244 0 0 } else if (git__prefixcmp(desc, "'") == 0)
247 0 0 if (name) {
264 0 0 if (type)
266 0 0 else if(name)
285 0 0 GIT_ASSERT_ARG(repo);
286 0 0 GIT_ASSERT_ARG(cb);
288 0 0 if (git_str_joinpath(&path, repo->gitdir, GIT_FETCH_HEAD_FILE) < 0)
291 0 0 if ((error = git_futils_readbuffer(&file, git_str_cstr(&path))) < 0)
296 0 0 while ((line = git__strsep(&buffer, "\n")) != NULL) {
299 0 0 if ((error = fetchhead_ref_parse(
303 0 0 if (git_str_len(&name) > 0)
309 0 0 if (error) {
315 0 0 if (*buffer) {
331 0 0 if (fetchhead_ref == NULL)