Example usage for org.eclipse.jgit.transport ReceivePack getPostReceiveHook

List of usage examples for org.eclipse.jgit.transport ReceivePack getPostReceiveHook

Introduction

In this page you can find the example usage for org.eclipse.jgit.transport ReceivePack getPostReceiveHook.

Prototype

public PostReceiveHook getPostReceiveHook() 

Source Link

Document

Get the hook invoked after updates occur.

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   w  w  w.  j  a v  a  2s .com*/

            result.setPostReceiveHook(hook);
            return result;
        }

    };
    setReceivePackFactory(rpf);
}