RFR: 1995: The logic for getting repository name and branch name in the backport pr command is inconsistent

Erik Joelsson erikj at openjdk.org
Thu Aug 17 15:21:12 UTC 2023


On Wed, 16 Aug 2023 20:32:34 GMT, Zhao Song <zsong at openjdk.org> wrote:

> In the backport pull request command, the process of getting the repository name and branch name differs between cancelling a backport request and creating a backport request. 
> 
> In this patch, I made the logic consistent.

bots/pr/src/main/java/org/openjdk/skara/bots/pr/BackportCommand.java line 185:

> 183:     }
> 184: 
> 185:     private Branch getTargetBranch(String targetBranchName, HostedRepository targetRepo, PrintWriter reply) {

I don't like how the string `"master"` is now repeated in three places. Could we move that check back here? We could add the parts index as a parameter to this method and supply the full array.

-------------

PR Review Comment: https://git.openjdk.org/skara/pull/1545#discussion_r1297377137


More information about the skara-dev mailing list