setPreReceiveHook( new PreReceiveHook() {
@Override
public void onPreReceive( final ReceivePack rp,
final Collection<ReceiveCommand> commands ) {
if ( clusterService != null ) {
clusterService.lock();
}
for ( final ReceiveCommand command : commands ) {
final RevCommit lastCommit = JGitUtil.getLastCommit( fs.gitRepo(), command.getRefName() );
oldTreeRefs.put( command.getRefName(), lastCommit );