Skip to content

Commit ab2c8f1

Browse files
authored
Handle to/from URLs without .git suffix (#82)
* Handle to/from URLs without .git suffix
1 parent b4b4464 commit ab2c8f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/avancement/service_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ func createPullRequest(ctx context.Context, fromURL, toURL, newBranchName, commi
251251
}
252252

253253
u, _ := url.Parse(toURL)
254-
// take out ".git" at the end
255-
pr, _, err := client.PullRequests.Create(ctx, u.Path[1:len(u.Path)-4], prInput)
254+
pathToUse := strings.TrimPrefix(strings.TrimSuffix(u.Path, ".git"), "/")
255+
pr, _, err := client.PullRequests.Create(ctx, pathToUse, prInput)
256256
return pr, err
257257
}
258258

0 commit comments

Comments
 (0)