aboutsummaryrefslogtreecommitdiffstats
path: root/repository.go
diff options
context:
space:
mode:
authorJoshua Sjoding <joshs@scjalliance.com>2016-01-23 00:50:29 -0800
committerJoshua Sjoding <joshs@scjalliance.com>2016-01-23 00:50:29 -0800
commit7ba1014b73e4d466320a29f7e3f47fcefe58695d (patch)
treebe9ff334eaae5547651d2084021fcfd4b70a9db9 /repository.go
parent050fb78d77b30014acd0b6eefc88ec8a49c20371 (diff)
downloadgo-git-7ba1014b73e4d466320a29f7e3f47fcefe58695d.tar.gz
Repository now works against the generic ObjectStore interface
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/repository.go b/repository.go
index 5deddfb..d0bc103 100644
--- a/repository.go
+++ b/repository.go
@@ -19,7 +19,7 @@ const (
type Repository struct {
Remotes map[string]*Remote
- Storage *core.RAWObjectStorage
+ Storage core.ObjectStorage
URL string
}
@@ -100,15 +100,7 @@ func (r *Repository) Commit(h core.Hash) (*Commit, error) {
// Commits decode the objects into commits
func (r *Repository) Commits() *CommitIter {
- i := NewCommitIter(r)
- go func() {
- defer i.Close()
- for _, obj := range r.Storage.Commits {
- i.Add(obj)
- }
- }()
-
- return i
+ return NewCommitIter(r, r.Storage.Iter(core.CommitObject))
}
// Tree return the tree with the given hash