Repository navigation
fix: replace "/" in git references when naming install folders - #77
Open
ehennestad wants to merge 4 commits into
Open
ehennestad wants to merge 4 commits into
ehennestad wants to merge 4 commits into
Conversation
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>
Contributor
Test Results91 tests 91 ✅ 28s ⏱️ Results for commit 88ed1e0. ♻️ This comment has been updated with latest results. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 createsStructEditor-codex/and puts the repository innansen-compatibility-contract/inside it. The repository folder is then named after the end of the reference, and a later lookup for a branch namedcodexmatches 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.0andrelease-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