fn(commit$0, state$1) =>
match $1.branch_latest_commit_hash {
#some(latest$2) =>
@core.list-concat(
left: match $1.is_branch_creator {
true =>
[],
false =>
[#not_branch_creator<@core.event-rejection>]
},
right: match @core.option-string-same(a: $0.parent_commit_hash, b: $1.branch_latest_commit_hash) {
true =>
[],
false =>
[#parent_commit_mismatch<@core.event-rejection>]
}
),
#none(_) =>
match $1.project_has_commits {
true =>
match $1.parent_in_project {
true =>
[],
false =>
[#parent_commit_mismatch<@core.event-rejection>]
},
false =>
@core.list-concat(
left: match @core.equal(left: $0.branch, right: "main") {
true =>
[],
false =>
[#first_branch_must_be_main<@core.event-rejection>]
},
right: match match $0.parent_commit_hash {
#none(_) =>
true,
#some(p$9) =>
false
} {
true =>
[],
false =>
[#parent_commit_mismatch<@core.event-rejection>]
}
)
}
}