summaryrefslogtreecommitdiff
path: root/odb.go
diff options
context:
space:
mode:
authorlhchavez <[email protected]>2021-09-05 13:59:36 -0700
committerGitHub <[email protected]>2021-09-05 13:59:36 -0700
commitdbe032c347b1a1308a4b880e7c5a06d8dfb4d507 (patch)
treebc64fbe9c30ed7dedbff0845c3354be77de1ae30 /odb.go
parent549706bb573653469fbcc35c839759987c318d0c (diff)
Make all non-user-creatable structures non-comparable (#802)
This change makes all non-user-creatable structures non-comparable. This makes it easier to add changes later that don't introduce breaking changes from the go compatibility guarantees perspective. This, of course, implies that this change _is_ a breaking change, but since these structures are not intended to be created by users (or de-referenced), it should be okay.
Diffstat (limited to 'odb.go')
-rw-r--r--odb.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/odb.go b/odb.go
index cef13bb..5550b91 100644
--- a/odb.go
+++ b/odb.go
@@ -22,10 +22,12 @@ import (
)
type Odb struct {
+ doNotCompare
ptr *C.git_odb
}
type OdbBackend struct {
+ doNotCompare
ptr *C.git_odb_backend
}
@@ -45,7 +47,7 @@ func NewOdb() (odb *Odb, err error) {
}
func NewOdbBackendFromC(ptr unsafe.Pointer) (backend *OdbBackend) {
- backend = &OdbBackend{(*C.git_odb_backend)(ptr)}
+ backend = &OdbBackend{ptr: (*C.git_odb_backend)(ptr)}
return backend
}
@@ -313,6 +315,7 @@ func (v *OdbBackend) Free() {
}
type OdbObject struct {
+ doNotCompare
ptr *C.git_odb_object
}
@@ -356,6 +359,7 @@ func (object *OdbObject) Data() (data []byte) {
}
type OdbReadStream struct {
+ doNotCompare
ptr *C.git_odb_stream
Size uint64
Type ObjectType
@@ -396,6 +400,7 @@ func (stream *OdbReadStream) Free() {
}
type OdbWriteStream struct {
+ doNotCompare
ptr *C.git_odb_stream
Id Oid
}
@@ -440,6 +445,7 @@ func (stream *OdbWriteStream) Free() {
// OdbWritepack is a stream to write a packfile to the ODB.
type OdbWritepack struct {
+ doNotCompare
ptr *C.git_odb_writepack
stats C.git_transfer_progress
ccallbacks C.git_remote_callbacks