Skip to content

Commit 94e12c8

Browse files
authored
Remove repeat code in GiteeCreatePullRequestPublisher.java (#153)
1 parent e06b035 commit 94e12c8

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

src/main/java/com/gitee/jenkins/publisher/GiteeCreatePullRequestPublisher.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -177,29 +177,6 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
177177
client.createPullRequest(pr);
178178
LOGGER.log(Level.INFO, "Pull request {0} generated, {1} -> {2}", LoggerUtil.toArray(title, head, base));
179179
}
180-
181-
if (build.getResult() == Result.SUCCESS) {
182-
PullRequest pr = PullRequestBuilder.pullRequest()
183-
.withRepoOwner(owner)
184-
.withRepoPath(repo)
185-
.withTitle(pullRequestTitle)
186-
.withSourceBranch(head)
187-
.withTargetBranch(base)
188-
.withDescription(body)
189-
.build();
190-
191-
if (!client.getPullRequest(pr).isEmpty()) {
192-
LOGGER.log(Level.INFO, "Pull request {0} -> {1} already exists", LoggerUtil.toArray(head, base));
193-
if (launcher != null) {
194-
launcher.getListener().getLogger().println("Pull request {0} -> {1} already exists");
195-
}
196-
197-
return true;
198-
}
199-
200-
client.createPullRequest(pr);
201-
LOGGER.log(Level.INFO, "Pull request {0} generated, {1} -> {2}", LoggerUtil.toArray(title, head, base));
202-
}
203180

204181
return true;
205182
}

0 commit comments

Comments
 (0)