GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(shared): escape literal SSH path punctuation when switching to HT… · patroza/t3code@c6df984

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/shared/src
    • cloneUrl.test.ts
    • cloneUrl.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/shared/src/cloneUrl.test.ts‎

Copy file name to clipboardExpand all lines: packages/shared/src/cloneUrl.test.ts
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ describe("cloneUrlForProtocol", () => {
149149
expect(cloneUrlForProtocol(scp, "https")).toBe(https);
150150
expect(cloneUrlForProtocol(`ssh://[email protected]/team/${encoded}`, "https")).toBe(https);
151151
}
152+
expect(cloneUrlForProtocol("ssh://[email protected]/team/repo%20name#1?.git", "https")).toBe(
153+
"https://host.example/team/repo%20name%231%3F.git",
154+
);
152155
});
153156

154157
it("keeps the URL as is for its own protocol and drops HTTPS credentials on switch", () => {
Collapse file

‎packages/shared/src/cloneUrl.ts‎

Copy file name to clipboardExpand all lines: packages/shared/src/cloneUrl.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export function cloneUrlForProtocol(url: string, protocol: CloneProtocol): strin
8080
if (protocol === "ssh") return `git@${host}:${decodeURIComponent(parsed.path)}`;
8181
const path = parsed.scp
8282
? parsed.path.split("/").map(encodeURIComponent).join("/")
83-
: parsed.path;
83+
: parsed.path.replaceAll("#", "%23").replaceAll("?", "%3F");
8484
return `https://${host}/${path}`;
8585
} catch {
8686
return null;

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.