RFR: Accept trailing slash in URIs for git fork.

Erik Helin ehelin at openjdk.java.net
Tue Apr 14 09:33:31 UTC 2020

On Tue, 14 Apr 2020 09:29:07 GMT, Erik Helin <ehelin at openjdk.org> wrote:

>> Consider a command like this:
>> $ git fork https://github.com/openjdk/skara/
>> This fails with a fairly cryptic error:
>> Apr 09, 2020 11:39:44 AM org.openjdk.skara.network.RestRequest transformBadResponse
>> WARNING: org.openjdk.skara.network.RestRequest$QueryBuilder at 2a17b7b6
>> Apr 09, 2020 11:39:44 AM org.openjdk.skara.network.RestRequest transformBadResponse
>> WARNING: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
>> Exception in thread "main" java.lang.RuntimeException: Request returned bad status: 404
>>         at org.openjdk.skara.network/org.openjdk.skara.network.RestRequest.transformBadResponse(RestRequest.java:285)
>>         at org.openjdk.skara.network/org.openjdk.skara.network.RestRequest.execute(RestRequest.java:325)
>>         at org.openjdk.skara.network/org.openjdk.skara.network.RestRequest$QueryBuilder.execute(RestRequest.java:156)
>>         at org.openjdk.skara.forge/org.openjdk.skara.forge.github.GitHubRepository.fork(GitHubRepository.java:231)
>>         at org.openjdk.skara.cli/org.openjdk.skara.cli.GitFork.main(GitFork.java:278)
>>         at org.openjdk.skara.cli/org.openjdk.skara.cli.GitSkara.main(GitSkara.java:186)
>> The cause is the trailing '/', which is normally accepted when accessing the repository through a web browser, or when
>> cloning the repository. This patch changes the git fork to also accept trailing slashes, by removing them before the
>> GitHubRepository repository instance is created. It is not quite clear if this should be solved at some other level,
>> but felt like a better approach to keep the APIs clean (i.e. just plain repository names), and do normalization in the
>> UI tools.
> Looks good!

Hi Jan,

thanks for contributing! Just a super minor nit before you integrate this pull request, could you remove the "."
(period) in the title? In general we don't end pull request titles with a period, similar to how we in JBS don't end
bug titles with a period.



PR: https://git.openjdk.java.net/skara/pull/575

More information about the skara-dev mailing list