本文整理汇总了Java中org.eclipse.jgit.transport.PreReceiveHook类的典型用法代码示例。如果您正苦于以下问题:Java PreReceiveHook类的具体用法?Java PreReceiveHook怎么用?Java PreReceiveHook使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PreReceiveHook类属于org.eclipse.jgit.transport包,在下文中一共展示了PreReceiveHook类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.eclipse.jgit.transport.PreReceiveHook; //导入依赖的package包/类
@Override
public void init(Project.NameKey project, ReceivePack rp) {
ProjectState ps = projectCache.get(project);
if (!ps.isEnableSignedPush()) {
rp.setSignedPushConfig(null);
return;
} else if (signedPushConfig == null) {
log.error(
"receive.enableSignedPush is true for project {} but"
+ " false in gerrit.config, so signed push verification is"
+ " disabled",
project.get());
rp.setSignedPushConfig(null);
return;
}
rp.setSignedPushConfig(signedPushConfig);
List<PreReceiveHook> hooks = new ArrayList<>(3);
if (ps.isRequireSignedPush()) {
hooks.add(SignedPushPreReceiveHook.Required.INSTANCE);
}
hooks.add(hook);
hooks.add(rp.getPreReceiveHook());
rp.setPreReceiveHook(PreReceiveHookChain.newChain(hooks));
}