aboutsummaryrefslogtreecommitdiffstats
path: root/common_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 /common_test.go
parent0f97041639b55bc4631145e2053a47a1eb8cdef0 (diff)
downloadgo-git-a3418c5e0a3c6e925b5a4fb3ecb1d3db56408d1a.tar.gz
Repository: Clone protection if non empty object storage, Remote: NoErrAlreadyUpToDate
Diffstat (limited to 'common_test.go')
-rw-r--r--common_test.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/common_test.go b/common_test.go
index dbacddd..e02e9d6 100644
--- a/common_test.go
+++ b/common_test.go
@@ -22,7 +22,7 @@ type BaseSuite struct {
Repository *Repository
}
-func (s *BaseSuite) SetUpTest(c *C) {
+func (s *BaseSuite) SetUpSuite(c *C) {
clients.InstallProtocol("mock", func(end common.Endpoint) common.GitUploadPackService {
return &MockGitUploadPackService{endpoint: end}
})
@@ -75,12 +75,16 @@ func (p *MockGitUploadPackService) Info() (*common.GitUploadPackInfo, error) {
}, nil
}
-func (p *MockGitUploadPackService) Fetch(*common.GitUploadPackRequest) (io.ReadCloser, error) {
+func (p *MockGitUploadPackService) Fetch(r *common.GitUploadPackRequest) (io.ReadCloser, error) {
if !p.connected {
return nil, errors.New("not connected")
}
- return os.Open("formats/packfile/fixtures/git-fixture.ref-delta")
+ if len(r.Wants) == 1 {
+ return os.Open("formats/packfile/fixtures/git-fixture.ref-delta")
+ }
+
+ return os.Open("fixtures/pack-63bbc2e1bde392e2205b30fa3584ddb14ef8bd41.pack")
}
func (p *MockGitUploadPackService) Disconnect() error {