From 1ea6099e561cc58f4a305ffe27df2ff7452c1fbe Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Sun, 17 Jul 2011 18:54:38 +0200 Subject: [PATCH] accept update events --- .../src/main/java/sonia/scm/web/GitPostReceiveHook.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/GitPostReceiveHook.java b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/GitPostReceiveHook.java index b3c12c886e..eba8b8f977 100644 --- a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/GitPostReceiveHook.java +++ b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/GitPostReceiveHook.java @@ -109,7 +109,7 @@ public class GitPostReceiveHook implements PostReceiveHook for (ReceiveCommand rc : receiveCommands) { - if (isCreateCommand(rc)) + if (isCreateOrUpdateCommand(rc)) { RevCommit commit = walk.parseCommit(rc.getNewId()); @@ -150,10 +150,12 @@ public class GitPostReceiveHook implements PostReceiveHook * * @return */ - private boolean isCreateCommand(ReceiveCommand rc) + private boolean isCreateOrUpdateCommand(ReceiveCommand rc) { return (rc.getResult() == ReceiveCommand.Result.OK) - && (rc.getType() == ReceiveCommand.Type.CREATE); + && ((rc.getType() == ReceiveCommand.Type.CREATE) + || (rc.getType() == ReceiveCommand.Type.UPDATE) + || (rc.getType() == ReceiveCommand.Type.UPDATE_NONFASTFORWARD)); } //~--- fields ---------------------------------------------------------------