Loading
Qualify default branch ref in ignore_revs_file_blob
What does this MR do and why?
Repository#ignore_revs_file_blob passed the bare default branch name as the
Gitaly revision. When the branch name starts with - (possible via import,
mirror, or update-ref), Gitaly's revision validation rejects it and the raw
GRPC::InvalidArgument (revision can't start with '-') escapes into the
repository tree view render, causing a 500.
This MR qualifies the revision as refs/heads/#{project.default_branch},
matching the existing call sites for the same file in Gitlab::Blame and
Resolvers::BlameResolver. A no-op for valid branch names.
How to set up and validate locally
- Create a project and set a dash-prefixed default branch directly in the
repo, e.g.
git update-ref refs/heads/-foo <sha>+git symbolic-ref HEAD refs/heads/-foo. - Visit the project's repository tree page.
- Before: 500 (
GRPC::InvalidArgument). After: page renders normally.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Gavin Hinfey