aboutsummaryrefslogtreecommitdiffstats
path: root/cshared/tree_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/tree_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/tree_cshared.go')
-rw-r--r--cshared/tree_cshared.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/cshared/tree_cshared.go b/cshared/tree_cshared.go
index 8533f60..12e360e 100644
--- a/cshared/tree_cshared.go
+++ b/cshared/tree_cshared.go
@@ -21,7 +21,7 @@ func c_Tree_get_Entries_len(t uint64) int {
if !ok {
return 0
}
- tree := obj.(*git.Tree)
+ tree := obj.(*object.Tree)
return len(tree.Entries)
}
@@ -33,7 +33,7 @@ func c_Tree_get_Entries_item(t uint64, index int) (*_Ctype_char, uint32, *_Ctype
if !ok {
return nil, 0, nil
}
- tree := obj.(*git.Tree)
+ tree := obj.(*object.Tree)
item := tree.Entries[index]
return _Cfunc_CString(item.Name), uint32(item.Mode), CBytes(item.Hash[:])
}
@@ -46,7 +46,7 @@ func c_Tree_get_Hash(t uint64) *_Ctype_char {
if !ok {
return nil
}
- tree := obj.(*git.Tree)
+ tree := obj.(*object.Tree)
return CBytes(tree.Hash[:])
}
@@ -58,7 +58,7 @@ func c_Tree_File(t uint64, path string) (uint64, int, *_Ctype_char) {
if !ok {
return IH, ErrorCodeNotFound, _Cfunc_CString(MessageNotFound)
}
- tree := obj.(*git.Tree)
+ tree := obj.(*object.Tree)
file, err := tree.File(CopyString(path))
if err != nil {
return IH, ErrorCodeInternal, _Cfunc_CString(err.Error())
@@ -74,7 +74,7 @@ func c_Tree_Type(t uint64) int8 {
if !ok {
return -1
}
- tree := obj.(*git.Tree)
+ tree := obj.(*object.Tree)
return int8(tree.Type())
}
@@ -86,7 +86,7 @@ func c_Tree_Files(t uint64) uint64 {
if !ok {
return IH
}
- tree := obj.(*git.Tree)
+ tree := obj.(*object.Tree)
iter := tree.Files()
return uint64(RegisterObject(iter))
}
@@ -99,8 +99,8 @@ func c_Tree_Decode(o uint64) (uint64, int, *_Ctype_char) {
if !ok {
return IH, ErrorCodeNotFound, _Cfunc_CString(MessageNotFound)
}
- cobj := obj.(*plumbing.Object)
- tree := git.Tree{}
+ cobj := obj.(*plumbing.EncodedObject)
+ tree := object.Tree{}
err := tree.Decode(*cobj)
if err != nil {
return IH, ErrorCodeInternal, _Cfunc_CString(err.Error())
@@ -121,8 +121,8 @@ func c_NewTreeWalker(r uint64, t uint64) uint64 {
if !ok {
return IH
}
- tree := obj.(*git.Tree)
- walker := git.NewTreeIter(repo, tree)
+ tree := obj.(*object.Tree)
+ walker := object.NewTreeIter(repo, tree)
return uint64(RegisterObject(walker))
}
@@ -134,7 +134,7 @@ func c_TreeWalker_Next(tw uint64) (*_Ctype_char, *_Ctype_char, uint32, *_Ctype_c
if !ok {
return nil, nil, 0, nil, ErrorCodeNotFound, _Cfunc_CString(MessageNotFound)
}
- walker := obj.(*git.TreeIter)
+ walker := obj.(*object.TreeIter)
name, entry, err := walker.Next()
if err != nil {
return nil, nil, 0, nil, ErrorCodeInternal, _Cfunc_CString(err.Error())
@@ -151,7 +151,7 @@ func c_TreeWalker_Tree(tw uint64) uint64 {
if !ok {
return IH
}
- walker := obj.(*git.TreeIter)
+ walker := obj.(*object.TreeIter)
return uint64(RegisterObject(walker.Tree()))
}
@@ -163,7 +163,7 @@ func c_TreeWalker_Close(tw uint64) {
if !ok {
return
}
- walker := obj.(*git.TreeIter)
+ walker := obj.(*object.TreeIter)
walker.Close()
}
*/