You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/11/05 10:40:42 UTC
[camel] 02/05: Camel-Git: Reformat
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 2cafdf2403cca29a82e5cf21b3c41a8eb5238f30
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Nov 5 09:31:32 2020 +0100
Camel-Git: Reformat
---
.../apache/camel/component/git/consumer/AbstractGitConsumer.java | 2 +-
.../org/apache/camel/component/git/consumer/GitCommitConsumer.java | 7 ++++---
.../org/apache/camel/component/git/consumer/GitConsumerTest.java | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/AbstractGitConsumer.java b/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/AbstractGitConsumer.java
index 5916642..0fb735e 100644
--- a/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/AbstractGitConsumer.java
+++ b/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/AbstractGitConsumer.java
@@ -79,6 +79,6 @@ public abstract class AbstractGitConsumer extends ScheduledPollConsumer {
return git;
}
- @Override
+ @Override
protected abstract int poll() throws Exception;
}
diff --git a/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitCommitConsumer.java b/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitCommitConsumer.java
index b016175..6719de5 100644
--- a/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitCommitConsumer.java
+++ b/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitCommitConsumer.java
@@ -37,10 +37,11 @@ public class GitCommitConsumer extends AbstractGitConsumer {
protected int poll() throws Exception {
int count = 0;
Iterable<RevCommit> commits;
- if (ObjectHelper.isNotEmpty(((GitEndpoint)getEndpoint()).getBranchName())) {
- commits = getGit().log().add(getGit().getRepository().resolve(((GitEndpoint)getEndpoint()).getBranchName())).call();
+ if (ObjectHelper.isNotEmpty(((GitEndpoint) getEndpoint()).getBranchName())) {
+ commits = getGit().log().add(getGit().getRepository().resolve(((GitEndpoint) getEndpoint()).getBranchName()))
+ .call();
} else {
- commits = getGit().log().all().call();
+ commits = getGit().log().all().call();
}
for (RevCommit commit : commits) {
if (!commitsConsumed.contains(commit.getId())) {
diff --git a/components/camel-git/src/test/java/org/apache/camel/component/git/consumer/GitConsumerTest.java b/components/camel-git/src/test/java/org/apache/camel/component/git/consumer/GitConsumerTest.java
index d7d6282..3b2357f 100644
--- a/components/camel-git/src/test/java/org/apache/camel/component/git/consumer/GitConsumerTest.java
+++ b/components/camel-git/src/test/java/org/apache/camel/component/git/consumer/GitConsumerTest.java
@@ -66,7 +66,7 @@ public class GitConsumerTest extends GitTestSupport {
assertEquals("Test test Commit", ex1.getMessage().getBody(RevCommit.class).getShortMessage());
git.close();
}
-
+
@Test
public void commitConsumerNotExistingBranchTest() throws Exception {
// Init