This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch camel-3.14.x in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.14.x by this push: new 35765b9 CAMEL-17473: camel-github: startingSha=last doesn't work properly. Thanks to Andrea Pilo for the patch. 35765b9 is described below commit 35765b9872e1a0abde1144447eaf475bad2fb36c Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue Jan 11 16:44:49 2022 +0100 CAMEL-17473: camel-github: startingSha=last doesn't work properly. Thanks to Andrea Pilo for the patch. --- .../org/apache/camel/component/github/consumer/CommitConsumer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/camel-github/src/main/java/org/apache/camel/component/github/consumer/CommitConsumer.java b/components/camel-github/src/main/java/org/apache/camel/component/github/consumer/CommitConsumer.java index f4abe1f..d8afce2 100644 --- a/components/camel-github/src/main/java/org/apache/camel/component/github/consumer/CommitConsumer.java +++ b/components/camel-github/src/main/java/org/apache/camel/component/github/consumer/CommitConsumer.java @@ -76,8 +76,11 @@ public class CommitConsumer extends AbstractGitHubConsumer { LOG.info("GitHub CommitConsumer: Indexing current commits..."); List<RepositoryCommit> commits = commitService.getCommits(getRepository(), branchName, null); for (RepositoryCommit commit : commits) { - commitHashes.add(commit.getSha()); - lastSha = commit.getSha(); + String sha = commit.getSha(); + commitHashes.add(sha); + if (lastSha == null) { + lastSha = sha; + } } LOG.info("GitHub CommitConsumer: Starting from last sha: {}", lastSha); } else if (!startingSha.equals("beginning")) {