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

Function gc_root_dir

src/pipeline/pass_operator.c:1792–1806  ·  view source on GitHub ↗

The repository dir a chart load's unknown root stood for: the matched * chart directory without the tail. */

Source from the content-addressed store, hash-verified

1790/* The repository dir a chart load's unknown root stood for: the matched
1791 * chart directory without the tail. */
1792static void gc_root_dir(const char *chart, const char *tail, char *out, size_t out_sz) {
1793 while (tail[0] == '.' && tail[SKIP_ONE] == '/') {
1794 tail += PAIR_LEN;
1795 }
1796 while (*tail == '/') {
1797 tail++;
1798 }
1799 size_t cl = strlen(chart);
1800 size_t tl = strlen(tail);
1801 while (tl && tail[tl - SKIP_ONE] == '/') {
1802 tl--;
1803 }
1804 size_t rl = cl > tl ? cl - tl - SKIP_ONE : 0;
1805 snprintf(out, out_sz, "%.*s", (int)rl, chart);
1806}
1807
1808static const char GC_CONFLICT[] = "\x01";
1809

Callers 1

gc_link_sitesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected