aboutsummaryrefslogtreecommitdiffstats
path: root/references_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'references_test.go')
-rw-r--r--references_test.go24
1 files changed, 11 insertions, 13 deletions
diff --git a/references_test.go b/references_test.go
index 4bd91d2..7e003bd 100644
--- a/references_test.go
+++ b/references_test.go
@@ -20,17 +20,15 @@ var _ = Suite(&ReferencesSuite{})
// create the repositories of the fixtures
func (s *ReferencesSuite) SetUpSuite(c *C) {
s.repos = make(map[string]*Repository, 0)
- for _, fixRepo := range fixtureRepos {
- s.repos[fixRepo.url] = NewPlainRepository()
+ for _, fix := range fixtureRepos {
+ s.repos[fix.url] = NewPlainRepository()
- d, err := os.Open(fixRepo.packfile)
- defer d.Close()
+ f, err := os.Open(fix.packfile)
+ defer f.Close()
c.Assert(err, IsNil)
-
- r := packfile.NewReader(d)
- r.Format = packfile.OFSDeltaFormat // TODO: how to know the format of a pack file ahead of time?
-
- _, err = r.Read(s.repos[fixRepo.url].Storage)
+ r := packfile.NewSeekable(f)
+ d := packfile.NewDecoder(r)
+ err = d.Decode(s.repos[fix.url].Storage)
c.Assert(err, IsNil)
}
}
@@ -339,10 +337,10 @@ func compareSideBySide(a []string, b []*Commit) string {
var buf bytes.Buffer
buf.WriteString("\t EXPECTED OBTAINED ")
var sep string
- var obtained string
+ var obt string
for i := range a {
- obtained = b[i].Hash.String()
- if a[i] != obtained {
+ obt = b[i].Hash.String()
+ if a[i] != obt {
sep = "------"
} else {
sep = " "
@@ -351,7 +349,7 @@ func compareSideBySide(a []string, b []*Commit) string {
buf.WriteString(sep)
buf.WriteString(a[i])
buf.WriteString(sep)
- buf.WriteString(obtained)
+ buf.WriteString(obt)
}
return buf.String()
}