aboutsummaryrefslogtreecommitdiffstats
path: root/cshared/objects_cshared.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-12-14 23:12:44 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-12-14 23:12:44 +0100
commit0af572dd21c0aa79d13745b633ee24ba6c4d6cf1 (patch)
tree49e81e74e82d84fd88b2fc1e4b0dc7c7bfe9c40f /cshared/objects_cshared.go
parentdf0f38af83f972f026d7e14150f3d37b95f13484 (diff)
downloadgo-git-0af572dd21c0aa79d13745b633ee24ba6c4d6cf1.tar.gz
move plumbing from top level package to plumbing (#183)
* plumbing: rename Object -> EncodedObject. * plumbing/storer: rename ObjectStorer -> EncodedObjectStorer. * move difftree to plumbing/difftree. * move diff -> utils/diff * make Object/Tag/Blob/Tree/Commit/File depend on storer. * Object and its implementations now depend only on storer.EncodedObjectStorer, not git.Repository. * Tests are decoupled accordingly. * move Object/Commit/File/Tag/Tree to plumbing/object. * move Object/Commit/File/Tag/Tree to plumbing/object. * move checkClose to utils/ioutil. * move RevListObjects to plumbing/revlist.Objects. * move DiffTree to plumbing/difftree package. * rename files with plural nouns to singular * plumbing/object: add GetBlob/GetCommit/GetTag/GetTree.
Diffstat (limited to 'cshared/objects_cshared.go')
-rw-r--r--cshared/objects_cshared.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/cshared/objects_cshared.go b/cshared/objects_cshared.go
index 54b9426..60bac40 100644
--- a/cshared/objects_cshared.go
+++ b/cshared/objects_cshared.go
@@ -6,8 +6,8 @@ import (
"io/ioutil"
"time"
- "gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing"
+ "gopkg.in/src-d/go-git.v4/plumbing/object"
)
//export c_Signature_Name
@@ -16,7 +16,7 @@ func c_Signature_Name(s uint64) *C.char {
if !ok {
return nil
}
- sign := obj.(*git.Signature)
+ sign := obj.(*object.Signature)
return C.CString(sign.Name)
}
@@ -26,7 +26,7 @@ func c_Signature_Email(s uint64) *C.char {
if !ok {
return nil
}
- sign := obj.(*git.Signature)
+ sign := obj.(*object.Signature)
return C.CString(sign.Email)
}
@@ -36,13 +36,13 @@ func c_Signature_When(s uint64) *C.char {
if !ok {
return nil
}
- sign := obj.(*git.Signature)
+ sign := obj.(*object.Signature)
return C.CString(sign.When.Format(time.RFC3339))
}
//export c_Signature_Decode
func c_Signature_Decode(b []byte) uint64 {
- sign := git.Signature{}
+ sign := object.Signature{}
sign.Decode(b)
return uint64(RegisterObject(&sign))
}
@@ -53,7 +53,7 @@ func c_Blob_get_Hash(b uint64) *C.char {
if !ok {
return nil
}
- blob := obj.(*git.Blob)
+ blob := obj.(*object.Blob)
return CBytes(blob.Hash[:])
}
@@ -63,7 +63,7 @@ func c_Blob_Size(b uint64) int64 {
if !ok {
return -1
}
- blob := obj.(*git.Blob)
+ blob := obj.(*object.Blob)
return blob.Size
}
@@ -73,8 +73,8 @@ func c_Blob_Decode(o uint64) uint64 {
if !ok {
return IH
}
- cobj := obj.(*plumbing.Object)
- blob := git.Blob{}
+ cobj := obj.(*plumbing.EncodedObject)
+ blob := object.Blob{}
blob.Decode(*cobj)
return uint64(RegisterObject(&blob))
}
@@ -85,7 +85,7 @@ func c_Blob_Read(b uint64) (int, *C.char) {
if !ok {
return ErrorCodeNotFound, C.CString(MessageNotFound)
}
- blob := obj.(*git.Blob)
+ blob := obj.(*object.Blob)
reader, err := blob.Reader()
if err != nil {
return ErrorCodeInternal, C.CString(err.Error())
@@ -104,6 +104,6 @@ func c_Blob_Type(c uint64) int8 {
if !ok {
return -1
}
- blob := obj.(*git.Blob)
+ blob := obj.(*object.Blob)
return int8(blob.Type())
}