Make parseRepoUrl handle a repository URL that ends in .git and a slash #4
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
parseRepoUrlin web/js/tools/clone.js strips.gitand then trailing slashes, in that order. Forhttps://github.com/o/r.git/the.gitis not at the end when it is stripped, so the result hasrepo: "r.git"and the clone step asks for a repository that does not exist. Why it matters: People paste clone URLs from many places; one trailing slash should not turn a valid URL into a confusing not-found error.Proposal
Strip trailing slashes first and then
.git, and change nothing else.Acceptance criteria
parseRepoUrl("https://github.com/o/r.git/")returns{ host: "github", owner: "o", repo: "r", branch: null }.parseRepoUrl("github.com/o/r.git")returns{ host: "github", owner: "o", repo: "r", branch: null }.parseRepoUrl("https://github.com/o/r/tree/dev")returns{ host: "github", owner: "o", repo: "r", branch: "dev" }.parseRepoUrl("https://example.org/o/r")throws an Error.Files
web/js/tools/clone.jsT2T-Issue: 0x7d766b278444220169f62e66c6786393ee201feadd01aaa6982b44acb1c4c757
Number: 4
Kind: bug
Origin: imported
Proposer: 0x08809b42d05ae9526f4aa4c9670ce168aac68919
Ledger: elffuss/ledger, event 106