@@ -71,6 +71,14 @@ func (pi *PersonInfo) tree(name string, depth int) []string {
71
71
}
72
72
73
73
func (pi * PersonInfo ) resolve (p []string ) (interface {}, []string , error ) {
74
+ if p == nil {
75
+ return map [string ]interface {}{
76
+ "name" : pi .Name ,
77
+ "email" : pi .Email ,
78
+ "date" : pi .Date + " " + pi .Timezone ,
79
+ }, nil , nil
80
+ }
81
+
74
82
switch p [0 ] {
75
83
case "name" :
76
84
return pi .Name , p [1 :], nil
@@ -157,6 +165,18 @@ func (c *Commit) RawData() []byte {
157
165
}
158
166
159
167
func (c * Commit ) Resolve (path []string ) (interface {}, []string , error ) {
168
+ if path == nil {
169
+ return map [string ]interface {}{
170
+ "parents" : c .Parents ,
171
+ "author" : c .Author ,
172
+ "committer" : c .Committer ,
173
+ "signature" : c .Sig .Text ,
174
+ "message" : c .Message ,
175
+ "tree" : & node.Link {Cid : c .GitTree },
176
+ "mergetag" : c .MergeTag ,
177
+ }, nil , nil
178
+ }
179
+
160
180
if len (path ) == 0 {
161
181
return nil , nil , fmt .Errorf ("zero length path" )
162
182
}
@@ -260,6 +280,15 @@ func (c *Commit) GitSha() []byte {
260
280
}
261
281
262
282
func (t * MergeTag ) resolve (path []string ) (interface {}, []string , error ) {
283
+ if path == nil {
284
+ return map [string ]interface {}{
285
+ "object" : & node.Link {Cid : t .Object },
286
+ "tag" : t .Tag ,
287
+ "tagger" : t .Tagger ,
288
+ "text" : t .Text ,
289
+ "type" : t .Type ,
290
+ }, nil , nil
291
+ }
263
292
if len (path ) == 0 {
264
293
return nil , nil , fmt .Errorf ("zero length path" )
265
294
}
0 commit comments