Skip to content

fix: replace "/" in git references when naming install folders - #77

Open
ehennestad wants to merge 4 commits into
mainfrom
name-install-folders-for-slash-refs
Open

ehennestad wants to merge 4 commits into
mainfrom
name-install-folders-for-slash-refs

Conversation

@ehennestad

Copy link
Copy Markdown
Owner

installGithubRepository renames the unzipped archive of a GitHub requirement to <repo>-<ref>, and lookForRepository searches the MATLAB path for that name. When the reference contains "/" (for example @codex/nansen-compatibility-contract), the name is a nested path: movefile creates StructEditor-codex/ and puts the repository in nansen-compatibility-contract/ inside it. The repository folder is then named after the end of the reference, and a later lookup for a branch named codex matches the parent folder and fails with "Expected repository to contain a Readme and LICENSE file".

This PR adds matbox.setup.internal.github.repositoryFolderName, which returns <repo>-<ref> with each "/" replaced by "-", and uses it in both functions. GitHub names the top-level folder of a branch archive by the same rule, so a branch install needs no rename.

Known limitation: references that differ only by "/" versus "-", such as release/1.0 and release-1.0, map to the same folder. If a requirement switches from one to the other, lookForRepository finds the existing folder and skips the download. GitHub's archive folder names have the same collision.

🤖 Generated with Claude Code

installGithubRepository renamed an unzipped archive to "<repo>-<ref>",
and lookForRepository searched the path for the same name. A reference
such as "codex/nansen-compatibility-contract" made that name a nested
path: movefile created "StructEditor-codex/" and put the repository in
"nansen-compatibility-contract/" inside it. The repository folder was
then named after the end of the reference, and a later lookup for a
branch named "codex" matched the parent folder and failed its README
and LICENSE check.

Both functions now take the name from repositoryFolderName, which
replaces each "/" in the reference with "-". GitHub names the top-level
folder of a branch archive the same way (observed for StructEditor's
codex/nansen-compatibility-contract and MatBox's
feature/buildtool-support), so a branch install needs no rename.

The references "release/1.0" and "release-1.0" map to the same folder
name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

91 tests   91 ✅  28s ⏱️
 7 suites   0 💤
 1 files     0 ❌

Results for commit 88ed1e0.

♻️ This comment has been updated with latest results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant