From ab2c8f174c9450ee0a82573053d6a6ff5979ea93 Mon Sep 17 00:00:00 2001 From: Adam Roberts Date: Wed, 20 May 2020 09:45:57 +0100 Subject: [PATCH] Handle to/from URLs without .git suffix (#82) * Handle to/from URLs without .git suffix --- pkg/avancement/service_manager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/avancement/service_manager.go b/pkg/avancement/service_manager.go index fc8fa77..82d086f 100644 --- a/pkg/avancement/service_manager.go +++ b/pkg/avancement/service_manager.go @@ -251,8 +251,8 @@ func createPullRequest(ctx context.Context, fromURL, toURL, newBranchName, commi } u, _ := url.Parse(toURL) - // take out ".git" at the end - pr, _, err := client.PullRequests.Create(ctx, u.Path[1:len(u.Path)-4], prInput) + pathToUse := strings.TrimPrefix(strings.TrimSuffix(u.Path, ".git"), "/") + pr, _, err := client.PullRequests.Create(ctx, pathToUse, prInput) return pr, err }