1# forge.requireapproval: main moves only to a tree someone other than the2# review's author approved; approvals are keyed by tree.3. "$(dirname "$0")/../lib.sh"4user dami5user ana6repo dami/greet7git --git-dir="$FORGE_ROOT/dami/greet.git" config forge.requireapproval true8clone dami dami/greet "$T/w/dami"9at "$T/w/dami" commit "first"10# The first push of main has no review to approve, so it needs one too.11fails_with "is not approved" push_as dami "$T/w/dami" origin main12git --git-dir="$FORGE_ROOT/dami/greet.git" config forge.requireapproval false13ok push_as dami "$T/w/dami" origin main14git --git-dir="$FORGE_ROOT/dami/greet.git" config forge.requireapproval true1516at "$T/w/dami" git switch -q -c dami/feature17at "$T/w/dami" commit "feature"18ok push_as dami "$T/w/dami" origin dami/feature19fails_with "an approval has to come from someone else" ssh_as dami approve dami/greet 120fails_with "is not approved" push_as dami "$T/w/dami" origin dami/feature:main21ok ssh_as ana approve dami/greet 122has "$FORGE_ROOT/dami/greet.git/forge/reviews/1" '^approve [0-9]+ ana '23# Rewording keeps the tree, so the approval still counts.24at "$T/w/dami" git commit -q --amend -m "feature, reworded"25ok push_as dami "$T/w/dami" -f origin dami/feature26ok push_as dami "$T/w/dami" origin dami/feature:main