Branch Coverage

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


line true false branch
47 0 456 if (GIT_ATTR_IS_TRUE(value))
49 0 456 else if (GIT_ATTR_IS_FALSE(value))
51 0 456 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 228 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 45 if (!path)
87 0 45 if (git_repository_index__weakptr(&index, repo) < 0) {
92 11 34 if (!(entry = git_index_get_bypath(index, path, 0)) &&
10 1 if (!(entry = git_index_get_bypath(index, path, 0)) &&
96 0 35 if (!S_ISREG(entry->mode)) /* don't crlf filter non-blobs */
99 0 35 if (git_blob_lookup(&blob, repo, &entry->id) < 0)
104 0 35 if (!git__is_sizet(blobsize))
107 35 0 found_cr = (blobcontent != NULL &&
108 35 0 blobsize > 0 &&
0 35 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 45 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 47 0 if (ca->crlf_action == GIT_CRLF_BINARY || !git_buf_len(from))
2 45 if (ca->crlf_action == GIT_CRLF_BINARY || !git_buf_len(from))
227 45 0 if (ca->crlf_action == GIT_CRLF_AUTO ||
8 37 if (ca->crlf_action == GIT_CRLF_AUTO ||
228 8 0 ca->crlf_action == GIT_CRLF_AUTO_INPUT ||
231 0 45 if (is_binary)
238 0 45 if (has_cr_in_index(src))
242 0 45 if ((error = check_safecrlf(ca, src, &stats)) < 0)
246 42 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 228 0 if ((error = git_repository__configmap_lookup(&ca->auto_crlf,
297 228 0 git_filter_source_repo(src), GIT_CONFIGMAP_AUTO_CRLF)) < 0 ||
299 0 228 git_filter_source_repo(src), GIT_CONFIGMAP_SAFE_CRLF)) < 0 ||
305 128 100 if ((git_filter_source_flags(src) & GIT_FILTER_ALLOW_UNSAFE) &&
0 128 if ((git_filter_source_flags(src) & GIT_FILTER_ALLOW_UNSAFE) &&
309 228 0 if (attr_values) {
313 228 0 if (ca->crlf_action == GIT_CRLF_UNDEFINED)
316 228 0 if (ca->crlf_action != GIT_CRLF_BINARY) {
320 0 228 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 228 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 228 else if (eol_attr == GIT_EOL_LF)
326 0 228 else if (eol_attr == GIT_EOL_CRLF)
335 0 228 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 228 0 if (ca->crlf_action == GIT_CRLF_UNDEFINED && ca->auto_crlf == GIT_AUTO_CRLF_FALSE)
169 59 if (ca->crlf_action == GIT_CRLF_UNDEFINED && ca->auto_crlf == GIT_AUTO_CRLF_FALSE)
339 59 169 if (ca->crlf_action == GIT_CRLF_UNDEFINED && ca->auto_crlf == GIT_AUTO_CRLF_TRUE)
12 47 if (ca->crlf_action == GIT_CRLF_UNDEFINED && ca->auto_crlf == GIT_AUTO_CRLF_TRUE)
341 47 181 if (ca->crlf_action == GIT_CRLF_UNDEFINED && ca->auto_crlf == GIT_AUTO_CRLF_INPUT)
47 0 if (ca->crlf_action == GIT_CRLF_UNDEFINED && ca->auto_crlf == GIT_AUTO_CRLF_INPUT)
359 169 59 if (ca.crlf_action == GIT_CRLF_BINARY)
363 0 59 GIT_ERROR_CHECK_ALLOC(*payload);
377 0 63 if (!*payload) {
380 0 0 if (error < 0)
384 16 47 if (git_filter_source_mode(src) == GIT_FILTER_SMUDGE)
401 0 86 if (f == NULL)