MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_parse_name_status

Function cbm_parse_name_status

src/pipeline/pass_gitdiff.c:87–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87int cbm_parse_name_status(const char *output, cbm_changed_file_t *out, int max_out) {
88 if (!output || !out || max_out <= 0) {
89 return 0;
90 }
91
92 int count = 0;
93 const char *line = output;
94
95 while (*line && count < max_out) {
96 const char *eol = strchr(line, '\n');
97 size_t line_len = eol ? (size_t)(eol - line) : strlen(line);
98
99 if (line_len > 0) {
100 cbm_changed_file_t f;
101 if (parse_one_name_status(line, line_len, &f)) {
102 out[count++] = f;
103 }
104 }
105
106 line = eol ? eol + SKIP_ONE : line + line_len;
107 }
108 return count;
109}
110
111/* Parse a single @@ hunk header line and emit a hunk entry if valid.
112 * Returns true if a hunk was added. */

Callers 1

test_pipeline.cFile · 0.85

Calls 1

parse_one_name_statusFunction · 0.85

Tested by

no test coverage detected