Fix branch-cleanup: fall back to head.label for deleted branches #248

Merged
eblume merged 1 commit from fix/branch-cleanup-ref-label into main 2026-02-22 16:15:51 -08:00
Owner

Summary

  • Forgejo rewrites head.ref to refs/pull/N/head once a PR's source branch is deleted from the remote
  • The original branch name is preserved in head.label
  • This was causing 188 out of 246 merged PRs to go undetected by the cleanup script
  • Fix: fall back to head.label when head.ref starts with refs/pull/

Test plan

  • Dry run correctly identifies 18 previously-missed local branches
  • Live run successfully deleted all 18
## Summary - Forgejo rewrites `head.ref` to `refs/pull/N/head` once a PR's source branch is deleted from the remote - The original branch name is preserved in `head.label` - This was causing 188 out of 246 merged PRs to go undetected by the cleanup script - Fix: fall back to `head.label` when `head.ref` starts with `refs/pull/` ## Test plan - [x] Dry run correctly identifies 18 previously-missed local branches - [x] Live run successfully deleted all 18
Forgejo rewrites head.ref to refs/pull/N/head once the source branch
is deleted from the remote. The original branch name is preserved in
head.label. This was causing 188 out of 246 merged PRs to be missed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
eblume merged commit 198c810e86 into main 2026-02-22 16:15:51 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
eblume/blumeops!248
No description provided.