This repository was archived by the owner on Sep 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ func (c *Commit) Tree() (*Tree, error) {
3838func (c * Commit ) Parents () * CommitIter {
3939 return NewCommitIter (c .r , core .NewObjectLookupIter (
4040 c .r .s .ObjectStorage (),
41+ core .CommitObject ,
4142 c .parents ,
4243 ))
4344}
Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ func (t ObjectType) String() string {
7070 return "ofs-delta"
7171 case REFDeltaObject :
7272 return "ref-delta"
73+ case AnyObject :
74+ return "any"
7375 default :
7476 return "unknown"
7577 }
@@ -116,15 +118,17 @@ func ParseObjectType(value string) (typ ObjectType, err error) {
116118type ObjectLookupIter struct {
117119 storage ObjectStorage
118120 series []Hash
121+ t ObjectType
119122 pos int
120123}
121124
122125// NewObjectLookupIter returns an object iterator given an object storage and
123126// a slice of object hashes.
124- func NewObjectLookupIter (storage ObjectStorage , series []Hash ) * ObjectLookupIter {
127+ func NewObjectLookupIter (storage ObjectStorage , t ObjectType , series []Hash ) * ObjectLookupIter {
125128 return & ObjectLookupIter {
126129 storage : storage ,
127130 series : series ,
131+ t : t ,
128132 }
129133}
130134
@@ -137,7 +141,7 @@ func (iter *ObjectLookupIter) Next() (Object, error) {
137141 return nil , io .EOF
138142 }
139143 hash := iter .series [iter .pos ]
140- obj , err := iter .storage .Get (AnyObject , hash )
144+ obj , err := iter .storage .Get (iter . t , hash )
141145 if err == nil {
142146 iter .pos ++
143147 }
You can’t perform that action at this time.
0 commit comments