Branch Coverage

deps/libgit2/src/crlf.c
Criterion Covered Total %
branch 71 158 44.9


line true false branch
47 0 538 if (GIT_ATTR_IS_TRUE(value))
49 0 538 else if (GIT_ATTR_IS_FALSE(value))
51 0 538 else if (GIT_ATTR_IS_UNSPECIFIED(value))
53 0 0 else if (strcmp(value, "input") == 0)
55 0 0 else if (strcmp(value, "auto") == 0)
63 0 269 if (GIT_ATTR_IS_UNSPECIFIED(value))
65 0 0 else if (strcmp(value, "lf") == 0)
67 0 0 else if (strcmp(value, "crlf") == 0)
84 0 57 if (!path)
87 0 57 if (git_repository_index__weakptr(&index, repo) < 0) {
92 11 46 if (!(entry = git_index_get_bypath(index, path, 0)) &&
10 1 if (!(entry = git_index_get_bypath(index, path, 0)) &&
96 0 47 if (!S_ISREG(entry->mode)) /* don't crlf filter non-blobs */
99 0 47 if (git_blob_lookup(&blob, repo, &entry->id) < 0)
104 0 47 if (!git__is_sizet(blobsize))
107 47 0 found_cr = (blobcontent != NULL &&
108 47 0 blobsize > 0 &&
0 47 blobsize > 0 &&
117 0 0 if (ca->auto_crlf == GIT_AUTO_CRLF_TRUE)
119 0 0 else if (ca->auto_crlf == GIT_AUTO_CRLF_INPUT)
122 0 0 if (ca->core_eol == GIT_EOL_CRLF)
146 0 0 return text_eol_is_crlf(ca) ? GIT_EOL_CRLF : GIT_EOL_LF;
160 57 0 if (!ca->safe_crlf)
163 0 0 if (output_eol(ca) == GIT_EOL_LF) {
168 0 0 if (stats->crlf) {
169 0 0 if (ca->safe_crlf == GIT_SAFE_CRLF_WARN) {
172 0 0 if (filename && *filename)
0 0 if (filename && *filename)
183 0 0 } else if (output_eol(ca) == GIT_EOL_CRLF) {
188 0 0 if (stats->crlf != stats->lf) {
189 0 0 if (ca->safe_crlf == GIT_SAFE_CRLF_WARN) {
192 0 0 if (filename && *filename)
0 0 if (filename && *filename)
219 59 0 if (ca->crlf_action == GIT_CRLF_BINARY || !git_buf_len(from))
2 57 if (ca->crlf_action == GIT_CRLF_BINARY || !git_buf_len(from))
227 57 0 if (ca->crlf_action == GIT_CRLF_AUTO ||
12 45 if (ca->crlf_action == GIT_CRLF_AUTO ||
228 12 0 ca->crlf_action == GIT_CRLF_AUTO_INPUT ||
231 0 57 if (is_binary)
238 0 57 if (has_cr_in_index(src))
242 0 57 if ((error = check_safecrlf(ca, src, &stats)) < 0)
246 54 3 if (!stats.crlf)
262 16 0 if (git_buf_len(from) == 0 || output_eol(ca) != GIT_EOL_CRLF)
10 6 if (git_buf_len(from) == 0 || output_eol(ca) != GIT_EOL_CRLF)
268 3 3 if (stats.lf == 0 || stats.lf == stats.crlf)
0 3 if (stats.lf == 0 || stats.lf == stats.crlf)
271 3 0 if (ca->crlf_action == GIT_CRLF_AUTO ||
3 0 if (ca->crlf_action == GIT_CRLF_AUTO ||
272 3 0 ca->crlf_action == GIT_CRLF_AUTO_INPUT ||
276 0 3 if (stats.cr > 0)
280 0 3 if (is_binary)
296 269 0 if ((error = git_repository__configmap_lookup(&ca->auto_crlf,
297 269 0 git_filter_source_repo(src), GIT_CONFIGMAP_AUTO_CRLF)) < 0 ||
299 0 269 git_filter_source_repo(src), GIT_CONFIGMAP_SAFE_CRLF)) < 0 ||
305 169 100 if ((git_filter_source_flags(src) & GIT_FILTER_ALLOW_UNSAFE) &&
0 169 if ((git_filter_source_flags(src) & GIT_FILTER_ALLOW_UNSAFE) &&
309 269 0 if (attr_values) {
313 269 0 if (ca->crlf_action == GIT_CRLF_UNDEFINED)
316 269 0 if (ca->crlf_action != GIT_CRLF_BINARY) {
320 0 269 if (ca->crlf_action == GIT_CRLF_AUTO && eol_attr == GIT_EOL_LF)
0 0 if (ca->crlf_action == GIT_CRLF_AUTO && eol_attr == GIT_EOL_LF)
322 0 269 else if (ca->crlf_action == GIT_CRLF_AUTO && eol_attr == GIT_EOL_CRLF)
0 0 else if (ca->crlf_action == GIT_CRLF_AUTO && eol_attr == GIT_EOL_CRLF)
324 0 269 else if (eol_attr == GIT_EOL_LF)
326 0 269 else if (eol_attr == GIT_EOL_CRLF)
335 0 269 if (ca->crlf_action == GIT_CRLF_TEXT)
336 0 0 ca->crlf_action = text_eol_is_crlf(ca) ? GIT_CRLF_TEXT_CRLF : GIT_CRLF_TEXT_INPUT;
337 269 0 if (ca->crlf_action == GIT_CRLF_UNDEFINED && ca->auto_crlf == GIT_AUTO_CRLF_FALSE)
198 71 if (ca->crlf_action == GIT_CRLF_UNDEFINED && ca->auto_crlf == GIT_AUTO_CRLF_FALSE)
339 71 198 if (ca->crlf_action == GIT_CRLF_UNDEFINED && ca->auto_crlf == GIT_AUTO_CRLF_TRUE)
16 55 if (ca->crlf_action == GIT_CRLF_UNDEFINED && ca->auto_crlf == GIT_AUTO_CRLF_TRUE)
341 55 214 if (ca->crlf_action == GIT_CRLF_UNDEFINED && ca->auto_crlf == GIT_AUTO_CRLF_INPUT)
55 0 if (ca->crlf_action == GIT_CRLF_UNDEFINED && ca->auto_crlf == GIT_AUTO_CRLF_INPUT)
359 198 71 if (ca.crlf_action == GIT_CRLF_BINARY)
363 0 71 GIT_ERROR_CHECK_ALLOC(*payload);
377 0 75 if (!*payload) {
380 0 0 if (error < 0)
384 16 59 if (git_filter_source_mode(src) == GIT_FILTER_SMUDGE)
401 0 86 if (f == NULL)