Explorer

core.check-event-branch-status

description
Rules of a branch status change (project_branch_status): main has no status, the branch must exist, and only its creator can change its status (the same as taking snapshots on it). See docs/branch.md
type
Fn(change: @core.branch-status-change, state: @core.event-check-state) -> List<@core.event-rejection>
expression
fn(change$0, state$1) =>
  match @core.equal(left: $0.branch, right: "main") {
    true =>
      [#main_branch_has_no_status<@core.event-rejection>],
    false =>
      match $1.branch_latest_commit_hash {
        #none(_) =>
          [#branch_not_found<@core.event-rejection>],
        #some(_) =>
          match $1.is_branch_creator {
            true =>
              [],
            false =>
              [#not_branch_creator<@core.event-rejection>]
          }
      }
  }
visibility
public
core.check-event-branch-status (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: dsUcfEA6WnknH0p1Ti4QIqPqUn_JbEBam4HFGXzhFEI
content hash: lWOcMy5S0REeRAvpu1gGk1CNQb0vzIamWiLp3zjIyqA