mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-29 06:28:23 +02:00
url.PathEscape encodes '/' as %2F, which broke slash-bearing refs end-to-end: api.github.com/repos/o/r/commits/release%2Fv2 and raw.githubusercontent.com/o/r/release%2Fv2/... are not accepted by GitHub. The previous slash-ref tests only happened to pass because the httptest fixture rewrote hosts but matched paths verbatim. Add escapeRefPath that splits the ref on '/', PathEscapes each segment, and rejoins with '/'. Use it in githubRefExists (commits API) and in the rawPrefix built by fetchFromGitHub. The contents API already takes ref via QueryEscape, which is correct. This also fixes the failing TestFetchFromGitHub_ResolvesSlashRefAgainstAPI flagged by review on PR #2209. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: multica-agent <github@multica.ai>