summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2013-09-11 23:01:27 +0200
committerCarlos Martín Nieto <[email protected]>2013-09-11 23:01:27 +0200
commit008e1efb35b07b4a91dba69369b8217862f11abd (patch)
treee5c6924fdab8c021f7964d40c7b2e7a25736f7f5
parent3cbfdf37f48c7b2f8726ad7e60a963cae1d8fd21 (diff)
Object types are constants
Define the object type values as constants
-rw-r--r--object.go2
-rw-r--r--odb.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/object.go b/object.go
index c6cd8a8..98a84a4 100644
--- a/object.go
+++ b/object.go
@@ -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
diff --git a/odb.go b/odb.go
index 9d7d02e..7b2297e 100644
--- a/odb.go
+++ b/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))