Fix Forgejo default-branch resolution #660

Closed
opened 2026-05-09 00:46:28 +00:00 by barrettruth · 0 comments
Owner

Problem

Forgejo PR-create paths use git symbolic-scope, which is not a Git command.

Evidence:

  • lua/forge/backends/forgejo.lua:1019 in create_pr_web_url()
  • lua/forge/backends/forgejo.lua:1076 in default_branch_cmd()

Because the command is piped through sed, the shell can produce empty stdout without failing in the way the fallback expects. That can make default-branch lookup empty, abort compose creation, or fall back to main for web-create URLs even when the repo default branch is different.

Expected

Forgejo default-branch resolution should use a valid Git command and only fall back to the Forgejo API when local remote-head resolution truly fails.

Non-goals

Do not change PR-create UX or backend semantics beyond making default-branch resolution correct.

Context

Found during release-preview readiness audit. Remote Forgejo CI cannot currently be awaited because the Spark runner is down; use local verification for the fix.

## Problem Forgejo PR-create paths use `git symbolic-scope`, which is not a Git command. Evidence: - `lua/forge/backends/forgejo.lua:1019` in `create_pr_web_url()` - `lua/forge/backends/forgejo.lua:1076` in `default_branch_cmd()` Because the command is piped through `sed`, the shell can produce empty stdout without failing in the way the fallback expects. That can make default-branch lookup empty, abort compose creation, or fall back to `main` for web-create URLs even when the repo default branch is different. ## Expected Forgejo default-branch resolution should use a valid Git command and only fall back to the Forgejo API when local remote-head resolution truly fails. ## Non-goals Do not change PR-create UX or backend semantics beyond making default-branch resolution correct. ## Context Found during release-preview readiness audit. Remote Forgejo CI cannot currently be awaited because the Spark runner is down; use local verification for the fix.
Sign in to join this conversation.
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
barrettruth/forge.nvim#660
No description provided.