aboutsummaryrefslogtreecommitdiffstats
path: root/remote_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-25 17:25:31 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-25 17:25:31 +0200
commita3418c5e0a3c6e925b5a4fb3ecb1d3db56408d1a (patch)
tree23ab46cb3269a104d9b69e0d1a1bec3c340df112 /remote_test.go
parent0f97041639b55bc4631145e2053a47a1eb8cdef0 (diff)
downloadgo-git-a3418c5e0a3c6e925b5a4fb3ecb1d3db56408d1a.tar.gz
Repository: Clone protection if non empty object storage, Remote: NoErrAlreadyUpToDate
Diffstat (limited to 'remote_test.go')
-rw-r--r--remote_test.go19
1 files changed, 18 insertions, 1 deletions
diff --git a/remote_test.go b/remote_test.go
index 00766ad..9bafcd1 100644
--- a/remote_test.go
+++ b/remote_test.go
@@ -83,7 +83,24 @@ func (s *RemoteSuite) TestFetch(c *C) {
})
c.Assert(err, IsNil)
- c.Assert(sto.ObjectStorage().(*memory.ObjectStorage).Objects, HasLen, 28)
+ c.Assert(sto.ObjectStorage().(*memory.ObjectStorage).Objects, HasLen, 31)
+}
+
+func (s *RemoteSuite) TestFetchNoErrAlreadyUpToDate(c *C) {
+ sto := memory.NewStorage()
+ r := newRemote(sto, &config.RemoteConfig{Name: "foo", URL: RepositoryFixture})
+ r.upSrv = &MockGitUploadPackService{}
+
+ c.Assert(r.Connect(), IsNil)
+
+ o := &FetchOptions{
+ RefSpecs: []config.RefSpec{config.DefaultRefSpec},
+ }
+
+ err := r.Fetch(o)
+ c.Assert(err, IsNil)
+ err = r.Fetch(o)
+ c.Assert(err, Equals, NoErrAlreadyUpToDate)
}
func (s *RemoteSuite) TestHead(c *C) {