29370c57
refactor: one derivation of a proposal's branch name, in core
db.ProposalBranch and gitx.ProposalBranch each spelled out "proposals/" + id with different signatures and different error behaviour: db formatted anything including 0, gitx refused a non-positive id. Two derivations of one name is a proposal whose row and whose ref can disagree, which is painful to trace and cheap to prevent. core now owns ProposalPrefix and ProposalBranch(int64) (string, error). gitx.ProposalPrefix and db.BranchPrefix are that constant, gitx wraps core's error in ErrBadRev so its callers keep their failure class, and db.ProposalBranch delegates — inheriting core's refusal of a non-positive id, which is why its signature grew an error.
Eugene Blikh <bigbes@gmail.com> — 2026-07-22 14:49:19 UTC
Commit 29370c57a37881e83ccd640122126d22f87eb720 —
view raw patch
Parent(s):
e5927f58
| File | Status | + | − |
|---|---|---|---|
core/errors.go
|
M | +5 | |
core/proposal.go
|
M | +31 | -1 |
core/proposal_test.go
|
M | +31 | |
db/proposal.go
|
M | +11 | -7 |
db/proposal_test.go
|
M | +6 | -2 |
db/unit_test.go
|
M | +30 | -2 |
gitx/gitx_test.go
|
M | +9 | |
gitx/refsrule.go
|
M | +18 | -8 |