Example usage for org.eclipse.jgit.transport PostReceiveHook NULL

List of usage examples for org.eclipse.jgit.transport PostReceiveHook NULL

Introduction

In this page you can find the example usage for org.eclipse.jgit.transport PostReceiveHook NULL.

Prototype

PostReceiveHook NULL

To view the source code for org.eclipse.jgit.transport PostReceiveHook NULL.

Click Source Link

Document

A simple no-op hook.

Usage

From source file:com.tasktop.c2c.server.scm.web.GitSmartHttpServlet.java

License:Open Source License

public void setPostRecieveHook(final PostReceiveHook hook) {
    ReceivePackFactory<HttpServletRequest> rpf = new DefaultReceivePackFactory() {
        public ReceivePack create(final HttpServletRequest req, final Repository db)
                throws ServiceNotEnabledException, ServiceNotAuthorizedException {
            ReceivePack result = super.create(req, db);
            if (!result.getPostReceiveHook().equals(PostReceiveHook.NULL)) {
                throw new IllegalStateException();
            }//from  www.j  av a  2  s . c om

            result.setPostReceiveHook(hook);
            return result;
        }

    };
    setReceivePackFactory(rpf);
}