-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: normalize GitHub URLs ending in .git to not ending in .git #1804
fix: normalize GitHub URLs ending in .git to not ending in .git #1804
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Based on https://stackoverflow.com/questions/11068576/why-do-some-repository-urls-end-in-git-while-others-dont , I recommend to try url with stripped .git
first, and then fallback to not stripping it, to keep the same behavior with git.
Pinging @kristof-mattei just in case you forgot this PR |
@NobodyXu These calls here (in the code I modified) never fail. It is only later on when trying to fetch the releases that the API doesn't respond with releases for repos ending in Now, if I understand correctly, you'd prefer that I revert this code, and then change the code around where the API for the releases itself gets called. First with the original URL, and if it fails AND ends in |
No, what I mean is to extract the repository detection logic here into a function, the call it twice:
I'd want the repository detection logic to only happen in |
cc @kristof-mattei there's a
In case where user does not provide a github token, we could use
Use either Otherwise just fallback to regular path. |
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This would help: - redirect public gh repo `.git` to its canonical form - redirect public gh repo, which has been recently renamed - cases where redirection is needed to get the real repo This commit make it fallbacks to the previou surl, if getting the redirected url fail, in case the repository is private. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Thank you for this PR! I happen to have some time so I took over the work and complete it. |
Closes #1801, see #1803 for a more generic version.
Here I can add the test as the
GhApiClient
is never invoked.