Bug
The shared --from resolver treats any known forge URL with at least <owner>/<repo> path segments as a git repository. That means URLs like:
https://github.com/profullstack/sh1pt/issues/403
https://github.com/profullstack/sh1pt/tree/master/packages
are classified as kind: 'git'. The inferred name can become a subpath segment such as 403, and build --from may later try to git clone a non-cloneable issue/tree URL.
Repro
Call resolveInput('https://github.com/profullstack/sh1pt/issues/403').
Observed before the fix:
{ kind: 'git', inferredName: '403', value: 'https://github.com/profullstack/sh1pt/issues/403' }
Expected
Only forge repo-root URLs like https://github.com/profullstack/sh1pt should be classified as git repos. Forge issue, pull, tree, blob, and other subpath URLs should remain normal live URLs.
Proposed fix
Parse known forge URLs with URL and require exactly two path segments after the host for repo-root detection. Add regression tests for GitHub issue and tree URLs.
Bug
The shared
--fromresolver treats any known forge URL with at least<owner>/<repo>path segments as a git repository. That means URLs like:are classified as
kind: 'git'. The inferred name can become a subpath segment such as403, andbuild --frommay later try togit clonea non-cloneable issue/tree URL.Repro
Call
resolveInput('https://github.com/profullstack/sh1pt/issues/403').Observed before the fix:
Expected
Only forge repo-root URLs like
https://github.com/profullstack/sh1ptshould be classified as git repos. Forge issue, pull, tree, blob, and other subpath URLs should remain normal live URLs.Proposed fix
Parse known forge URLs with
URLand require exactly two path segments after the host for repo-root detection. Add regression tests for GitHub issue and tree URLs.