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

Function detect_valid_git_prefix

src/mcp/mcp.c:17837–17840  ·  view source on GitHub ↗

A `--show-prefix` answer: empty at the repository root, otherwise a * '/'-terminated relative directory. */

Source from the content-addressed store, hash-verified

17835/* A `--show-prefix` answer: empty at the repository root, otherwise a
17836 * '/'-terminated relative directory. */
17837static bool detect_valid_git_prefix(const char *value) {
17838 size_t length = strlen(value);
17839 return length == 0 || value[length - 1] == '/';
17840}
17841
17842/* Read one '\n'-terminated `git rev-parse` record (a trailing '\r' dropped)
17843 * into out when it is terminated, fits, and passes `valid`. Anything else is

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected