fix: support branch names with slashes in workspace.source URLs#22
Merged
fix: support branch names with slashes in workspace.source URLs#22
Conversation
When initializing a workspace with --from URL that specifies a branch with
slashes (e.g., feat/my-feature), two issues were fixed:
1. Branch name not preserved in workspace.source:
- The code was hardcoding 'main' branch when constructing workspace.source
- Now extracts and uses the actual branch from the --from URL
- Falls back to 'main' if no branch is specified
2. URL parsing failed for branches with slashes:
- parseGitHubUrl couldn't distinguish branch names from subpaths when
the branch name contained slashes (e.g., feat/allagents-workspace)
- Updated parsing logic to use heuristics: common directory names
(plugins, src, docs, etc.) indicate where the subpath begins
- Maintains backward compatibility with simple branch names
Fixes workspace sync failing with "File source not found" errors when using
workspace init with branch URLs like:
https://github.com/owner/repo/tree/feat/feature-name/plugins/name
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Deploying allagents with
|
| Latest commit: |
c8d7274
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://55f4a35c.allagents.pages.dev |
| Branch Preview URL: | https://fix-branch-slash-support.allagents.pages.dev |
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.
Summary
Fixes workspace sync failure when initializing with
--fromURLs that specify branches containing slashes (e.g.,feat/my-feature).Issues Fixed:
Branch name not preserved in
workspace.sourcewhen creating workspace from GitHub URL--fromURLURL parsing failed for branches with slashes
parseGitHubUrl()couldn't distinguish branch names from subpaths when branch contained slashesTest Plan
workspace init ./test --from https://github.com/WiseTechGlobal/WTG.AI.Prompts/tree/feat/allagents-workspace/plugins/cargowise🤖 Generated with Claude Code