Compare commits
15 Commits
Author | SHA1 | Date |
---|---|---|
|
6cc7d3dc6a | |
|
6ee3a5f589 | |
|
f0ad5b44b9 | |
|
53ee1f6e9a | |
|
75a20e5aeb | |
|
94786f9c8f | |
|
43550d0b7f | |
|
ecaeb7a21d | |
|
e209475ae0 | |
|
290d16a225 | |
|
bde7731d51 | |
|
c0c29489d9 | |
|
7696f18fed | |
|
9abc0506da | |
|
ef79809066 |
12
tag.go
12
tag.go
|
@ -21,26 +21,26 @@ func (t *Tag) AsObject() *Object {
|
|||
return &t.Object
|
||||
}
|
||||
|
||||
func (t Tag) Message() string {
|
||||
func (t *Tag) Message() string {
|
||||
ret := C.GoString(C.git_tag_message(t.cast_ptr))
|
||||
runtime.KeepAlive(t)
|
||||
return ret
|
||||
}
|
||||
|
||||
func (t Tag) Name() string {
|
||||
func (t *Tag) Name() string {
|
||||
ret := C.GoString(C.git_tag_name(t.cast_ptr))
|
||||
runtime.KeepAlive(t)
|
||||
return ret
|
||||
}
|
||||
|
||||
func (t Tag) Tagger() *Signature {
|
||||
func (t *Tag) Tagger() *Signature {
|
||||
cast_ptr := C.git_tag_tagger(t.cast_ptr)
|
||||
ret := newSignatureFromC(cast_ptr)
|
||||
runtime.KeepAlive(t)
|
||||
return ret
|
||||
}
|
||||
|
||||
func (t Tag) Target() *Object {
|
||||
func (t *Tag) Target() *Object {
|
||||
var ptr *C.git_object
|
||||
ret := C.git_tag_target(&ptr, t.cast_ptr)
|
||||
runtime.KeepAlive(t)
|
||||
|
@ -51,13 +51,13 @@ func (t Tag) Target() *Object {
|
|||
return allocObject(ptr, t.repo)
|
||||
}
|
||||
|
||||
func (t Tag) TargetId() *Oid {
|
||||
func (t *Tag) TargetId() *Oid {
|
||||
ret := newOidFromC(C.git_tag_target_id(t.cast_ptr))
|
||||
runtime.KeepAlive(t)
|
||||
return ret
|
||||
}
|
||||
|
||||
func (t Tag) TargetType() ObjectType {
|
||||
func (t *Tag) TargetType() ObjectType {
|
||||
ret := ObjectType(C.git_tag_target_type(t.cast_ptr))
|
||||
runtime.KeepAlive(t)
|
||||
return ret
|
||||
|
|
15
tree.go
15
tree.go
|
@ -47,7 +47,7 @@ func newTreeEntry(entry *C.git_tree_entry) *TreeEntry {
|
|||
}
|
||||
}
|
||||
|
||||
func (t Tree) EntryByName(filename string) *TreeEntry {
|
||||
func (t *Tree) EntryByName(filename string) *TreeEntry {
|
||||
cname := C.CString(filename)
|
||||
defer C.free(unsafe.Pointer(cname))
|
||||
|
||||
|
@ -67,7 +67,7 @@ func (t Tree) EntryByName(filename string) *TreeEntry {
|
|||
// free it, but you must not use it after the Tree is freed.
|
||||
//
|
||||
// Warning: this must examine every entry in the tree, so it is not fast.
|
||||
func (t Tree) EntryById(id *Oid) *TreeEntry {
|
||||
func (t *Tree) EntryById(id *Oid) *TreeEntry {
|
||||
runtime.LockOSThread()
|
||||
defer runtime.UnlockOSThread()
|
||||
|
||||
|
@ -84,7 +84,7 @@ func (t Tree) EntryById(id *Oid) *TreeEntry {
|
|||
|
||||
// EntryByPath looks up an entry by its full path, recursing into
|
||||
// deeper trees if necessary (i.e. if there are slashes in the path)
|
||||
func (t Tree) EntryByPath(path string) (*TreeEntry, error) {
|
||||
func (t *Tree) EntryByPath(path string) (*TreeEntry, error) {
|
||||
cpath := C.CString(path)
|
||||
defer C.free(unsafe.Pointer(cpath))
|
||||
var entry *C.git_tree_entry
|
||||
|
@ -102,7 +102,7 @@ func (t Tree) EntryByPath(path string) (*TreeEntry, error) {
|
|||
return newTreeEntry(entry), nil
|
||||
}
|
||||
|
||||
func (t Tree) EntryByIndex(index uint64) *TreeEntry {
|
||||
func (t *Tree) EntryByIndex(index uint64) *TreeEntry {
|
||||
entry := C.git_tree_entry_byindex(t.cast_ptr, C.size_t(index))
|
||||
if entry == nil {
|
||||
return nil
|
||||
|
@ -113,7 +113,7 @@ func (t Tree) EntryByIndex(index uint64) *TreeEntry {
|
|||
return goEntry
|
||||
}
|
||||
|
||||
func (t Tree) EntryCount() uint64 {
|
||||
func (t *Tree) EntryCount() uint64 {
|
||||
num := C.git_tree_entrycount(t.cast_ptr)
|
||||
runtime.KeepAlive(t)
|
||||
return uint64(num)
|
||||
|
@ -122,9 +122,8 @@ func (t Tree) EntryCount() uint64 {
|
|||
type TreeWalkCallback func(string, *TreeEntry) int
|
||||
|
||||
//export CallbackGitTreeWalk
|
||||
func CallbackGitTreeWalk(_root *C.char, _entry unsafe.Pointer, ptr unsafe.Pointer) C.int {
|
||||
func CallbackGitTreeWalk(_root *C.char, entry *C.git_tree_entry, ptr unsafe.Pointer) C.int {
|
||||
root := C.GoString(_root)
|
||||
entry := (*C.git_tree_entry)(_entry)
|
||||
|
||||
if callback, ok := pointerHandles.Get(ptr).(TreeWalkCallback); ok {
|
||||
return C.int(callback(root, newTreeEntry(entry)))
|
||||
|
@ -133,7 +132,7 @@ func CallbackGitTreeWalk(_root *C.char, _entry unsafe.Pointer, ptr unsafe.Pointe
|
|||
}
|
||||
}
|
||||
|
||||
func (t Tree) Walk(callback TreeWalkCallback) error {
|
||||
func (t *Tree) Walk(callback TreeWalkCallback) error {
|
||||
runtime.LockOSThread()
|
||||
defer runtime.UnlockOSThread()
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 6311e886d8b5377c6037cd9937ccf66a71f3361d
|
||||
Subproject commit 45c6187cbfdcfee2bcf59a1ed3a853065142f203
|
Loading…
Reference in New Issue