Skip to main content

pre_commit_rerun_required

Function pre_commit_rerun_required 

Source
pub fn pre_commit_rerun_required(
    no_verify: bool,
    policy_tree: &str,
    approved_tree: &str,
) -> bool
Expand description

What: Whether pre-commit must see the replayed tree: the invocation did not bypass hooks, and the policies changed the tree pre-commit last approved. Why: An unchanged tree was already approved, so re-running the hook would only repeat its answer.

In TS you’d write (pseudocode):

const rerun = !context.noVerify && policyTree !== approvedTree;