aboutsummaryrefslogtreecommitdiffstats
path: root/common_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'common_test.go')
-rw-r--r--common_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/common_test.go b/common_test.go
index f7416e0..e0d11b5 100644
--- a/common_test.go
+++ b/common_test.go
@@ -20,7 +20,9 @@ func Test(t *testing.T) { TestingT(t) }
type BaseSuite struct{}
func (s *BaseSuite) SetUpTest(c *C) {
- clients.InstallProtocol("mock", &MockGitUploadPackService{})
+ clients.InstallProtocol("mock", func(end common.Endpoint) common.GitUploadPackService {
+ return &MockGitUploadPackService{conected: end}
+ })
}
const RepositoryFixture = "mock://formats/packfile/fixtures/git-fixture.ref-delta"
@@ -30,15 +32,11 @@ type MockGitUploadPackService struct {
auth common.AuthMethod
}
-func (p *MockGitUploadPackService) Connect(url common.Endpoint) error {
- p.conected = url
+func (p *MockGitUploadPackService) Connect() error {
return nil
}
-func (p *MockGitUploadPackService) ConnectWithAuth(
- url common.Endpoint, auth common.AuthMethod,
-) error {
- p.conected = url
+func (p *MockGitUploadPackService) ConnectWithAuth(auth common.AuthMethod) error {
p.auth = auth
return nil
}
@@ -50,11 +48,13 @@ func (p *MockGitUploadPackService) Info() (*common.GitUploadPackInfo, error) {
c.Decode("6ecf0ef2c2dffb796033e5a02219af86ec6584e5 HEADmulti_ack thin-pack side-band side-band-64k ofs-delta shallow no-progress include-tag multi_ack_detailed no-done symref=HEAD:refs/heads/master agent=git/2:2.4.8~dbussink-fix-enterprise-tokens-compilation-1167-gc7006cf")
ref := core.ReferenceName("refs/heads/master")
+ tag := core.ReferenceName("refs/tags/v1.0.0")
return &common.GitUploadPackInfo{
Capabilities: c,
Refs: map[core.ReferenceName]*core.Reference{
core.HEAD: core.NewSymbolicReference(core.HEAD, ref),
ref: core.NewHashReference(ref, h),
+ tag: core.NewHashReference(tag, h),
},
}, nil
}