@@ -16,6 +16,12 @@ function treewalk(f::Function, tree::GitTree, payload=Any[], post::Bool = false)
16
16
return cbf_payload
17
17
end
18
18
19
+ function owner (tree:: GitTree )
20
+ repo_ptr = ccall ((:git_tree_owner , :libgit2 ), Ptr{Void},
21
+ (Ptr{Void},), tree. ptr)
22
+ return GitRepo (repo_ptr)
23
+ end
24
+
19
25
function filename (te:: GitTreeEntry )
20
26
str = ccall ((:git_tree_entry_name , :libgit2 ), Cstring, (Ptr{Void},), te. ptr)
21
27
str != C_NULL && return unsafe_string (str)
@@ -26,6 +32,15 @@ function filemode(te::GitTreeEntry)
26
32
return ccall ((:git_tree_entry_filemode , :libgit2 ), Cint, (Ptr{Void},), te. ptr)
27
33
end
28
34
35
+ function entrytype (te:: GitTreeEntry )
36
+ otype = ccall ((:git_tree_entry_type , :libgit2 ), Cint, (Ptr{Void},), te. ptr)
37
+ return getobjecttype (otype)
38
+ end
39
+
40
+ function entryid (te:: GitTreeEntry )
41
+ oid_ptr = ccall ((:git_tree_entry_id , :libgit2 ), Cint, (Ptr{Void},), te. ptr)
42
+ return GitHash (oid_ptr[])
43
+ end
29
44
30
45
function object (repo:: GitRepo , te:: GitTreeEntry )
31
46
obj_ptr_ptr = Ref {Ptr{Void}} (C_NULL )
@@ -34,3 +49,10 @@ function object(repo::GitRepo, te::GitTreeEntry)
34
49
obj_ptr_ptr, repo. ptr, te. ptr)
35
50
return GitUnknownObject (repo, obj_ptr_ptr[])
36
51
end
52
+
53
+ function Base. show (io:: IO , te:: GitTreeEntry )
54
+ println (io, " GitTreeEntry:" )
55
+ println (io, " Entry name: " , filename (te))
56
+ println (io, " Entry type: " , entrytype (te))
57
+ println (io, " Entry OID: " , entryid (te))
58
+ end
0 commit comments