Files
gotea/modules/git
lotherk 8189516c49 feat(got): list branches with got
Add got.Branches and route both GetBranchNames implementations through it,
so branch listing no longer runs git for-each-ref.

Names come from `got ref -l refs/heads/`, not `got branch -l`: the latter
also reports refs/remotes copies and can print a name twice. Order comes
from `got branch -lt`; names that pass misses are appended, so a failure
there degrades to lexical order instead of failing the listing.

Two got behaviours needed guarding:

- `-r` searches upwards. A path that is not a repository made got answer
  for the enclosing one, so a broken fixture silently returned the parent
  repository's refs. run now validates the target first.
- got refuses a repository without objects/pack or refs/. Those are empty
  directories, so a fixture checked into git loses them. run recreates the
  layout, content-free and idempotent.

repo2_empty carried .gitkeep files under refs/heads and refs/tags; got reads
them as references and fails with "bad reference name". Dropped both, the
layout is now created on demand.

Tests: go test ./modules/got ./modules/git ./modules/git -tags gogit
./services/repository/... ./modules/repository/... ./models/git/...
./routers/web/repo/... ./services/context/... - all pass. New tests cover
ordering, paging, remote-copy filtering, the missing-directory repair, the
enclosing-repository refusal, and absence of a git fallback.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 15:55:23 +00:00
..