Related to #11847 (review)
Given commit 7c75262e6f12881b1c700556460654616d992384 from few years ago and dead branch permissions for which exists closed PR #3.
git name-rev --exclude "refs/tags/*" --name-only --no-undefined 7c75262e6f12881b1c700556460654616d992384
pull/3/head~2602^2~3
git name-rev --refs "refs/heads/*" --name-only --no-undefined 7c75262e6f12881b1c700556460654616d992384
permissions~2603^2~3
I would expect that when browsing commit 7c75262e6f12881b1c700556460654616d992384 I am shown master as branch, not pull/3/head or permissions.
GetBranchName should behave something like this:
- if commit exists in default branch, use it
- otherwise select closest branch name
where closest branch is either newest branch for which HEAD there isn't entry in pull or otherwise branch that is closest (with fewest commits between HEAD and commit) if there is no other non-PR branch that contains commit.
Related to #11847 (review)
Given commit
7c75262e6f12881b1c700556460654616d992384from few years ago and dead branchpermissionsfor which exists closed PR#3.I would expect that when browsing commit
7c75262e6f12881b1c700556460654616d992384I am shownmasteras branch, notpull/3/headorpermissions.GetBranchNameshould behave something like this:where closest branch is either newest branch for which HEAD there isn't entry in
pullor otherwise branch that is closest (with fewest commits between HEAD and commit) if there is no other non-PR branch that contains commit.