aboutsummaryrefslogtreecommitdiffstats
path: root/remote_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-07-13 13:21:36 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2017-07-13 13:21:36 +0200
commitc0de8847ecbb20c99e652a8db5edc883c0e2f9ba (patch)
tree1027789d4692c5da82cc1e87606a48de42796371 /remote_test.go
parent6b3a6df29920d39b8308924b3b84178226b56224 (diff)
downloadgo-git-c0de8847ecbb20c99e652a8db5edc883c0e2f9ba.tar.gz
remote: avoid duplicate haves
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