aboutsummaryrefslogtreecommitdiffstats
path: root/remote_test.go
diff options
context:
space:
mode:
authorMiguel Molina <miguel@erizocosmi.co>2017-09-05 17:32:16 +0200
committerMiguel Molina <miguel@erizocosmi.co>2017-09-05 17:32:16 +0200
commit1c2fb310fbd3e08fddb43344c1473c27b154ef73 (patch)
treeaa1f9cd494f794f3e3db5c663f7165959c894498 /remote_test.go
parentf9a1c7a5a31a5d9836819b1469bbae76b5b0efef (diff)
downloadgo-git-1c2fb310fbd3e08fddb43344c1473c27b154ef73.tar.gz
remote: iterate over reference only once
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
Diffstat (limited to 'remote_test.go')
-rw-r--r--remote_test.go28
1 files changed, 15 insertions, 13 deletions
diff --git a/remote_test.go b/remote_test.go
index 10f6708..def5c8d 100644
--- a/remote_test.go
+++ b/remote_test.go
@@ -625,20 +625,22 @@ func (s *RemoteSuite) TestPushWrongRemoteName(c *C) {
}
func (s *RemoteSuite) TestGetHaves(c *C) {
- st := memory.NewStorage()
- st.SetReference(plumbing.NewReferenceFromStrings(
- "foo", "f7b877701fbf855b44c0a9e86f3fdce2c298b07f",
- ))
-
- st.SetReference(plumbing.NewReferenceFromStrings(
- "bar", "fe6cb94756faa81e5ed9240f9191b833db5f40ae",
- ))
-
- st.SetReference(plumbing.NewReferenceFromStrings(
- "qux", "f7b877701fbf855b44c0a9e86f3fdce2c298b07f",
- ))
+ var localRefs = []*plumbing.Reference{
+ plumbing.NewReferenceFromStrings(
+ "foo",
+ "f7b877701fbf855b44c0a9e86f3fdce2c298b07f",
+ ),
+ plumbing.NewReferenceFromStrings(
+ "bar",
+ "fe6cb94756faa81e5ed9240f9191b833db5f40ae",
+ ),
+ plumbing.NewReferenceFromStrings(
+ "qux",
+ "f7b877701fbf855b44c0a9e86f3fdce2c298b07f",
+ ),
+ }
- l, err := getHaves(st)
+ l, err := getHaves(localRefs)
c.Assert(err, IsNil)
c.Assert(l, HasLen, 2)
}