fix(git-gate): reject AGit review refs
test / integration-macos (pull_request) Has been skipped
test / integration-docker (pull_request) Successful in 33s
test / unit (pull_request) Successful in 54s
lint / lint (push) Successful in 1m0s
tracker-policy-pr / check-pr (pull_request) Successful in 8s
test / integration-firecracker (pull_request) Successful in 3m59s
test / coverage (pull_request) Successful in 16s
test / publish-infra (pull_request) Has been skipped

This commit is contained in:
2026-07-26 17:51:43 +00:00
parent 9c06702b32
commit 272e4eb776
2 changed files with 32 additions and 0 deletions
+17
View File
@@ -252,6 +252,23 @@ cat > "$refs_file"
zero=0000000000000000000000000000000000000000
# AGit creates pull requests by pushing to refs/for/* (with refs/draft/*
# and refs/for-review/* aliases). Those server-owned review refs are not
# ordinary repository branches and leave the resulting PR without a
# branch that the bottle can update later. Require the normal
# push-branch-then-open-PR workflow instead. Deletion remains allowed so
# operators can clean up refs created before this guard existed.
while IFS=' ' read -r old new ref; do
[ -z "$ref" ] && continue
[ "$new" = "$zero" ] && continue
case "$ref" in
refs/for/*|refs/draft/*|refs/for-review/*)
echo "git-gate: AGit review refs are disabled; push to refs/heads/<branch> and open the pull request from that branch" >&2
exit 1
;;
esac
done < "$refs_file"
supervise_gitleaks_allow() {
log_opts=$1
ref=$2