aboutsummaryrefslogtreecommitdiffstats
path: root/remote_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'remote_test.go')
-rw-r--r--remote_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/remote_test.go b/remote_test.go
index c12d5d5..501d06e 100644
--- a/remote_test.go
+++ b/remote_test.go
@@ -499,6 +499,25 @@ func (s *RemoteSuite) TestPushWrongRemoteName(c *C) {
c.Assert(err, ErrorMatches, ".*remote names don't match.*")
}
+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",
+ ))
+
+ l, err := getHaves(st)
+ c.Assert(err, IsNil)
+ c.Assert(l, HasLen, 2)
+}
+
const bareConfig = `[core]
repositoryformatversion = 0
filemode = true