Error is safe on a zero-value/externally-constructed RefRejectedError (one with no wrapped err), so embedders can build &RefRejectedError{Ref, Reason} in tests without a nil panic.
()
| 178 | // with no wrapped err), so embedders can build &RefRejectedError{Ref, Reason} |
| 179 | // in tests without a nil panic. |
| 180 | func (e *RefRejectedError) Error() string { |
| 181 | if e.err == nil { |
| 182 | return fmt.Sprintf("ref %s rejected: %s", e.Ref, e.Reason) |
| 183 | } |
| 184 | return e.err.Error() |
| 185 | } |
| 186 | |
| 187 | // Unwrap exposes the underlying receive-pack error so existing |
| 188 | // errors.As(*packp.CommandStatusErr) checks — and substring inspection of the |
no outgoing calls