Object types are constants
Define the object type values as constants
This commit is contained in:
parent
3cbfdf37f4
commit
008e1efb35
|
@ -10,7 +10,7 @@ import "runtime"
|
|||
|
||||
type ObjectType int
|
||||
|
||||
var (
|
||||
const (
|
||||
OBJ_ANY ObjectType = C.GIT_OBJ_ANY
|
||||
OBJ_BAD ObjectType = C.GIT_OBJ_BAD
|
||||
OBJ_COMMIT ObjectType = C.GIT_OBJ_COMMIT
|
||||
|
|
2
odb.go
2
odb.go
|
@ -23,7 +23,7 @@ func (v *Odb) Exists(oid *Oid) bool {
|
|||
return ret != 0
|
||||
}
|
||||
|
||||
func (v *Odb) Write(data []byte, otype int) (oid *Oid, err error) {
|
||||
func (v *Odb) Write(data []byte, otype ObjectType) (oid *Oid, err error) {
|
||||
oid = new(Oid)
|
||||
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&data))
|
||||
ret := C.git_odb_write(oid.toC(), v.ptr, unsafe.Pointer(hdr.Data), C.size_t(hdr.Len), C.git_otype(otype))
|
||||
|
|
Loading…
Reference in New Issue