t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Switching clone protocols corrupts escaped repository paths

Open saphitv opened this issue 2 weeks ago • 0 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

packages/contracts or packages/shared

Steps to reproduce

  1. Have a project with HTTPS origin https://git.example/team/my%20repo.git, where the repository's literal name is my repo.git and its working SCP-style SSH address is [email protected]:team/my repo.git.
  2. Open Run on → Add to another machine in the web client and choose another connected environment with SSH access to that repository.
  3. Select SSH, then start the clone.

This was found through source inspection and reproduced in the real web client using two isolated development environments on one Linux machine. A local SSH transport stub runs real git-upload-pack against a synthetic bare repository, so the reproduction does not depend on forge credentials or a live account. git.example is a fixture hostname.

Expected behavior

The generated SSH address is [email protected]:team/my repo.git, and cloning succeeds.

Actual behavior

The generated address is [email protected]:team/my%20repo.git. Unlike URI-style URLs, SCP-style Git addresses treat percent escapes literally, so Git requests the wrong repository and the clone fails.

The reverse conversion has the same representation problem: literal percent signs, #, or ? in SCP-style paths are copied into an HTTPS URL without encoding.

Impact

Minor bug or occasional failure. Cloning onto another environment fails for affected names even when the destination has valid SSH access.

Version or commit

Reproduced on main at 2482b03a01cf998a26cddbff65c5e5b0b0f39b38.

Environment

Linux, Chrome web client, isolated server state. Generic Git host path; Azure's host-specific rewriting is outside this report. No provider turn is needed.

Logs or stack traces

fatal: '/tmp/t3-clone-evidence/remotes/team/my%20repo.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Screenshots, recordings, or supporting files

Clone failure showing the incorrectly escaped repository path

Workaround

Keep using the original HTTPS address if the destination has HTTPS credentials, or clone manually using the correct SSH address and register that folder.

Proposed fix

Translate URI-escaped and literal SCP path components when switching protocols. PR #35322 implements this in the shared helper and extends the existing tests; it includes before/after captures and a base-versus-fix browser proof.

saphitv avatar Nov 12 '26 15:11 saphitv