Repository navigation
fix(core): isolate repository cache hosts - #55610
sdivyanshu90 wants to merge 1 commit into
Conversation
|
Hi @kitlangton, could you please review this PR whenever you have some time. Thanks! |
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
This looks good to me. I ran the reproduction from #55608 on the base and with this change. On the base both remotes map to /cache/git.example.com/8443/team/repo. With the change, the port-based remote gets git.example.com%3A8443/... and the other remote keeps its path. As a side effect, bracketed IPv6 hosts are no longer broken up into odd folders like [/1]. A host of .. is still rejected, and a literal % in a host is encoded again, so it can't collide with an encoded :. The repository and repository-cache tests pass (25), the new tests fail on the base, and the core typecheck passes.
Public API: unchanged. Only the on-disk folder layout of the repository cache changes for hosts with a port, and existing checkouts at the old paths are just cloned again once.
No concerns.
Related: #51577
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #55608
Type of change
What does this PR do?
Encode the repository authority as one cache directory component. A port-based remote such as
https://git.example.com:8443/team/repo.gitnow keeps a separate checkout from[email protected]:8443/team/repo.git, whose path starts with8443/.Existing caches for port-based remotes will be cloned once into the new location. Ordinary hostname paths stay the same.
How did you verify your code works?
From
packages/core, using Bun 1.4.3:bun run test test/repository.test.ts test/repository-cache.test.ts: 25 passed. Both new regressions fail before the fix. The integration test uses real local Git repositories and checks independent contents and cache reuse.bun typecheck: passed.git diff --check: passed.The repository-wide
bun run checkpassed lint with existing warnings, then stopped because the filtered dependency installation lacks GUI packages' dependencies (@tsconfig/node22).Screenshots / recordings
Not applicable; no rendered UI changes.
Checklist
Added by the opencode bot (AI-generated).
Related: #51577