dolthub/dolt

`ExistingRefError.Error()` omits the ref name and type

開放

#11,434 建立於 2026年8月6日

 (0 則留言) (0 個反應) (0 位負責人)Go (429 個分叉)batch import
bad error messagegood first issueversion control

倉庫指標

星標
 (15,227 顆星)
PR 合併指標
 (平均合併 2天 21小時) (30 天內合併 58 個 PR)

描述

doltdb.ExistingRefError is returned when a caller-provided name collides with an existing ref. Its Error() explicitly returns a "already exists", a bare string.

https://github.com/dolthub/dolt/blob/56fc3f4f292598b644df4397d5ef1799a5883c07/go/libraries/doltcore/doltdb/errors.go#L158-L162

The type carries a Ref field that identifies the conflict. Branch creation already recovers this detail out of band, but tag and workspaces do not.

Error() should include the ref, for example: ref 'refs/heads/x' already exists. Updating 'Error()` will change the message tag and workspace callers and test assert against, so they'll have to be updated with their own wrappers.

貢獻者指南