forked from farhoodlabs/paperclip
d30afdb1b2
27 tests covering the surface that had none: - parseGitSourceUrl: bare URLs (github/gitea/gitlab), tree/blob/src shapes, subpaths, file paths, trailing .git stripping, https-only enforcement, malformed/missing-segment rejection. - resolveGitRef: 40-hex SHA passthrough (no network call), default branch via HEAD symref, named branch, peeled annotated tag, lightweight tag, ref-not-found, network/401/404 error translation, onAuth callback shape (token-as-username, x-oauth-basic) and absence. - openRepoSnapshot: clone args (singleBranch/depth=1/noCheckout), tree walk filtering trees vs blobs, readFile path, SHA fallback when tracking ref is null, 404 translation. Mocks at the isomorphic-git boundary; verifies our adaptation logic, not isomorphic-git itself. Known limit surfaced by a test (not fixed here): gitea URLs with slash-containing branch names like /src/branch/feature/x are ambiguous without server-side disambiguation. The test uses a single-segment branch; the multi-segment case needs a separate fix (refCandidates from longest-to-shortest, resolved against listServerRefs output). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>