Beispiel #1
0
func (s *SuiteCommit) TestIterSliceClose(c *C) {
	for i, t := range iterTests {
		r := s.repos[t.repo]
		iter := NewCommitIter(r, core.NewObjectSliceIter(makeObjectSlice(t.commits, r.Storage)))
		s.checkIterClose(c, i, iter)
	}
}
Beispiel #2
0
// Iter returns a core.ObjectIter for the given core.ObjectTybe
func (o *ObjectStorage) Iter(t core.ObjectType) core.ObjectIter {
	var series []core.Object
	switch t {
	case core.CommitObject:
		series = flattenObjectMap(o.Commits)
	case core.TreeObject:
		series = flattenObjectMap(o.Trees)
	case core.BlobObject:
		series = flattenObjectMap(o.Blobs)
	}
	return core.NewObjectSliceIter(series)
}