@@ -17,56 +17,57 @@ import (
1717// Commit
1818type Commit struct {
1919 gitObject
20+ cast_ptr * C.git_commit
2021}
2122
2223func (c Commit ) Message () string {
23- return C .GoString (C .git_commit_message (c .ptr ))
24+ return C .GoString (C .git_commit_message (c .cast_ptr ))
2425}
2526
2627func (c Commit ) Tree () (* Tree , error ) {
27- var ptr * C.git_object
28+ var ptr * C.git_tree
2829
2930 runtime .LockOSThread ()
3031 defer runtime .UnlockOSThread ()
3132
32- err := C .git_commit_tree (& ptr , c .ptr )
33+ err := C .git_commit_tree (& ptr , c .cast_ptr )
3334 if err < 0 {
3435 return nil , MakeGitError (err )
3536 }
3637
37- return allocObject (ptr ).(* Tree ), nil
38+ return allocObject (( * C . git_object )( ptr ) ).(* Tree ), nil
3839}
3940
4041func (c Commit ) TreeId () * Oid {
41- return newOidFromC (C .git_commit_tree_id (c .ptr ))
42+ return newOidFromC (C .git_commit_tree_id (c .cast_ptr ))
4243}
4344
4445func (c Commit ) Author () * Signature {
45- ptr := C .git_commit_author (c .ptr )
46- return newSignatureFromC (ptr )
46+ cast_ptr := C .git_commit_author (c .cast_ptr )
47+ return newSignatureFromC (cast_ptr )
4748}
4849
4950func (c Commit ) Committer () * Signature {
50- ptr := C .git_commit_committer (c .ptr )
51- return newSignatureFromC (ptr )
51+ cast_ptr := C .git_commit_committer (c .cast_ptr )
52+ return newSignatureFromC (cast_ptr )
5253}
5354
5455func (c * Commit ) Parent (n uint ) * Commit {
55- var cobj * C.git_object
56- ret := C .git_commit_parent (& cobj , c .ptr , C .uint (n ))
56+ var cobj * C.git_commit
57+ ret := C .git_commit_parent (& cobj , c .cast_ptr , C .uint (n ))
5758 if ret != 0 {
5859 return nil
5960 }
6061
61- return allocObject (cobj ).(* Commit )
62+ return allocObject (( * C . git_object )( cobj ) ).(* Commit )
6263}
6364
6465func (c * Commit ) ParentId (n uint ) * Oid {
65- return newOidFromC (C .git_commit_parent_id (c .ptr , C .uint (n )))
66+ return newOidFromC (C .git_commit_parent_id (c .cast_ptr , C .uint (n )))
6667}
6768
6869func (c * Commit ) ParentCount () uint {
69- return uint (C .git_commit_parentcount (c .ptr ))
70+ return uint (C .git_commit_parentcount (c .cast_ptr ))
7071}
7172
7273// Signature
0 commit comments