Updating reflist in local repo.

This commit is contained in:
Andrey Smirnov
2014-02-24 23:45:47 +04:00
parent 4277f09e2a
commit 1b10c87bad
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -51,6 +51,11 @@ func (repo *LocalRepo) RefList() *PackageRefList {
return repo.packageRefs
}
// UpdateRefList changes package list for local repo
func (repo *LocalRepo) UpdateRefList(reflist *PackageRefList) {
repo.packageRefs = reflist
}
// Encode does msgpack encoding of LocalRepo
func (repo *LocalRepo) Encode() []byte {
var buf bytes.Buffer
+5
View File
@@ -46,6 +46,11 @@ func (s *LocalRepoSuite) TestRefList(c *C) {
c.Check(s.repo.RefList(), Equals, s.reflist)
}
func (s *LocalRepoSuite) TestUpdateRefList(c *C) {
s.repo.UpdateRefList(nil)
c.Check(s.repo.RefList(), IsNil)
}
func (s *LocalRepoSuite) TestEncodeDecode(c *C) {
repo := &LocalRepo{}
err := repo.Decode(s.repo.Encode())