# It’s important that on pre-receive 'increase_reference_counter' gets executed # last so that it only runs if everything else succeeded. On post-receive on the # other hand, we run GitlabPostReceive first because the push is already done # and we don’t want to skip it if the custom hook fails. if GitlabAccess.new(gl_repository, repo_path, gl_id, refs, protocol).exec && GitlabCustomHook.new(repo_path, gl_id).pre_receive(refs) && increase_reference_counter(gl_repository, repo_path) exit 0 else exit 1 end