Repository navigation
fix(git): keep the leading slash of an absolute scp-style repo path - #1217
Merged
jeff-r2026 merged 1 commit intoOct 20, 2026
Merged
Conversation
|
No findings in the specified PR diff. The fix preserves the leading slash for absolute scp-style paths while leaving relative paths unchanged. The added regression case checks exact URL preservation and repeated parsing. The PR description includes sufficient testing: a representative real-CLI run records the corrected absolute path passed to Review was read-only; I did not run, build, or install PR code. |
jeff-r2026
approved these changes
Oct 20, 2026
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
git@host:/srv/git/team.gitnames a repository at an absolute path on the SSH host, andgit@host:srv/git/team.gitone relative to the login's home directory.parseGenericGitRepoInputstrips the leading slash before rebuilding the scp-style URL (parsePathinsrc/providers/git/repo-url.ts), soteamai init git@host:/srv/git/team.git --provider gitclonessrv/git/team.gitinstead. On a plain SSH Git server that keeps repositories under/srv/gitthe clone fails with "Could not read from remote repository".The scp branch now keeps the slash when the input had one. HTTPS and
ssh://URLs already rebuild the path with a slash and are unchanged.Type of Change
Test Plan
npx tsc --noEmitpassesnpm run lintpassesnpx vitest runpasses (10989 pass; the same 6 tests fail onmainhere: twosubmodule-checkoutcases that need git >= 2.54 (local 2.53), onehooks-reconcile-scopereal-shell case, and three Cursor tests that need asqlite3CLI this machine does not have)git@git.example.com:/srv/git/repo.gitis added to the "preserves the clone path across repeated parsing" cases ingeneric-git-provider.test.ts; onmainit comes back asgit@git.example.com:srv/git/repo.git.Real CLI, throwaway HOME, with
GIT_SSH_COMMANDpointing at a script that logs the remote command and exits:ssh git@git.example.com git-upload-pack 'srv/git/team.git'ssh git@git.example.com git-upload-pack '/srv/git/team.git'git clone git@git.example.com:/srv/git/team.git:git-upload-pack '/srv/git/team.git'git@git.example.com:group/team.gitasks for'group/team.git'before and after.Related Issues
None found.