MCPcopy Create free account
hub / github.com/git/git / output_pattern

Function output_pattern

builtin/check-ignore.c:37–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35};
36
37static void output_pattern(const char *path, struct path_pattern *pattern)
38{
39 const char *bang = (pattern && pattern->flags & PATTERN_FLAG_NEGATIVE) ? "!" : "";
40 const char *slash = (pattern && pattern->flags & PATTERN_FLAG_MUSTBEDIR) ? "/" : "";
41 if (!nul_term_line) {
42 if (!verbose) {
43 write_name_quoted(path, stdout, '\n');
44 } else {
45 if (pattern) {
46 quote_c_style(pattern->pl->src, NULL, stdout, 0);
47 printf(":%d:%s%s%s\t",
48 pattern->srcpos,
49 bang, pattern->pattern, slash);
50 }
51 else {
52 printf("::\t");
53 }
54 quote_c_style(path, NULL, stdout, 0);
55 fputc('\n', stdout);
56 }
57 } else {
58 if (!verbose) {
59 printf("%s%c", path, '\0');
60 } else {
61 if (pattern)
62 printf("%s%c%d%c%s%s%s%c%s%c",
63 pattern->pl->src, '\0',
64 pattern->srcpos, '\0',
65 bang, pattern->pattern, slash, '\0',
66 path, '\0');
67 else
68 printf("%c%c%c%s%c", '\0', '\0', '\0', path, '\0');
69 }
70 }
71}
72
73static int check_ignore(struct dir_struct *dir,
74 const char *prefix, int argc, const char **argv)

Callers 1

check_ignoreFunction · 0.85

Calls 2

write_name_quotedFunction · 0.85
quote_c_styleFunction · 0.85

Tested by

no test coverage detected