aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java
index 4417d74..660ec21 100644
--- a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java
+++ b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java
@@ -182,12 +182,6 @@ public class BitbucketRepository {
logger.log(Level.INFO, "Post comment: {0} with original content {1}", new Object[]{ content, this.client.postPullRequestComment(pullRequestId, content).getId() });
}
- private boolean processTTPCommentBuildTags(String content, String buildKey) {
- if (!this.isTTPCommentBuildTags(content)) return true;
- logger.log(Level.INFO, "Processing ttp with build comment: {0}", content);
- return !this.hasMyBuildTagInTTPComment(content, buildKey);
- }
-
private boolean isTTPComment(String content) {
return content.toLowerCase().contains(BUILD_REQUEST_MARKER.toLowerCase());
}
@@ -241,6 +235,7 @@ public class BitbucketRepository {
boolean rebuildCommentAvailable = false;
if (comments != null) {
Collection<Pullrequest.Comment> filteredComments = this.filterPullRequestComments(comments);
+ boolean hasMyBuildTag = false;
for (Pullrequest.Comment comment : filteredComments) {
String content = comment.getContent();
if (this.isTTPComment(content)) {
@@ -249,10 +244,11 @@ public class BitbucketRepository {
"Rebuild comment available for commit {0} and comment #{1}",
new Object[]{ sourceCommit, comment.getId() }
);
- }
- rebuildCommentAvailable &= this.processTTPCommentBuildTags(content, buildKeyPart);
- if (!rebuildCommentAvailable) break;
+ }
+ if (isTTPCommentBuildTags(content))
+ hasMyBuildTag |= this.hasMyBuildTagInTTPComment(content, buildKeyPart);
}
+ rebuildCommentAvailable &= !hasMyBuildTag;
}
if (rebuildCommentAvailable) this.postBuildTagInTTPComment(id, "TTP build flag", buildKeyPart);