Skip to content

forge-gitlab: Fix template loading - #883

Merged
tarsius merged 2 commits into
magit:mainfrom
mjhoy:fix-gitlab-template-loading
Nov 5, 2026
Merged

tarsius merged 2 commits into
magit:mainfrom
mjhoy:fix-gitlab-template-loading

Conversation

@mjhoy

@mjhoy mjhoy commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

a6dec70 introduced a bug in resolving Gitlab template paths that causes forge-pull to fail for repositories with issue or merge request templates. You can see the issue demonstrated with this repository: https://gitlab.com/mjhoy/repro-forge-issue

This fix has two parts:

  1. Reference the full file path when reading (e.g., .gitlab/issue_templates/Default.md instead of Default.md)

  2. Read from the default branch instead of the local working tree (e.g., git cat-file -p origin/main:[PATH] instead of cat [PATH].)

Tested against the repro.

Closes #881.

mjhoy and others added 2 commits November 5, 2026 17:44
[1: a6dec70] introduced a bug in resolving Gitlab template paths
that causes `forge-pull' to fail for repositories with issue or
merge request templates.

- Reference the full file path when reading.
- Read from the default branch instead of the local working tree.

Closes magit#881.

1: 2026-10-20 a6dec70
   Get topic template using API and store in database
@tarsius
tarsius force-pushed the fix-gitlab-template-loading branch from dd3b0dc to 94958ba Compare November 5, 2026 16:49
@tarsius
tarsius merged commit 94958ba into magit:main Nov 5, 2026
@tarsius

tarsius commented Nov 5, 2026

Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitLab template loading can break forge-pull

2 participants