Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit e850aea

Browse files
committed
all: make the upcoming Go 1.11's vet happy
vet in 1.10 and earlier was buggy in how its "composite literal uses unkeyed fields" check had false negatives when it encountered a slice of pointer types that omitted each element's type. This has been fixed in tip, so adapt to that fix. Signed-off-by: Daniel Martí <[email protected]>
1 parent ede92fa commit e850aea

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

plumbing/transport/test/receive_pack.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (s *ReceivePackSuite) TestAdvertisedReferencesNotExists(c *C) {
5050
c.Assert(err, IsNil)
5151
req := packp.NewReferenceUpdateRequest()
5252
req.Commands = []*packp.Command{
53-
{"master", plumbing.ZeroHash, plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")},
53+
{Name: "master", Old: plumbing.ZeroHash, New: plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")},
5454
}
5555

5656
writer, err := r.ReceivePack(context.Background(), req)
@@ -99,7 +99,7 @@ func (s *ReceivePackSuite) TestFullSendPackOnEmpty(c *C) {
9999
fixture := fixtures.Basic().ByTag("packfile").One()
100100
req := packp.NewReferenceUpdateRequest()
101101
req.Commands = []*packp.Command{
102-
{"refs/heads/master", plumbing.ZeroHash, fixture.Head},
102+
{Name: "refs/heads/master", Old: plumbing.ZeroHash, New: fixture.Head},
103103
}
104104
s.receivePack(c, endpoint, req, fixture, full)
105105
s.checkRemoteHead(c, endpoint, fixture.Head)
@@ -110,7 +110,7 @@ func (s *ReceivePackSuite) TestSendPackWithContext(c *C) {
110110
req := packp.NewReferenceUpdateRequest()
111111
req.Packfile = fixture.Packfile()
112112
req.Commands = []*packp.Command{
113-
{"refs/heads/master", plumbing.ZeroHash, fixture.Head},
113+
{Name: "refs/heads/master", Old: plumbing.ZeroHash, New: fixture.Head},
114114
}
115115

116116
r, err := s.Client.NewReceivePackSession(s.EmptyEndpoint, s.EmptyAuth)
@@ -135,7 +135,7 @@ func (s *ReceivePackSuite) TestSendPackOnEmpty(c *C) {
135135
fixture := fixtures.Basic().ByTag("packfile").One()
136136
req := packp.NewReferenceUpdateRequest()
137137
req.Commands = []*packp.Command{
138-
{"refs/heads/master", plumbing.ZeroHash, fixture.Head},
138+
{Name: "refs/heads/master", Old: plumbing.ZeroHash, New: fixture.Head},
139139
}
140140
s.receivePack(c, endpoint, req, fixture, full)
141141
s.checkRemoteHead(c, endpoint, fixture.Head)
@@ -147,7 +147,7 @@ func (s *ReceivePackSuite) TestSendPackOnEmptyWithReportStatus(c *C) {
147147
fixture := fixtures.Basic().ByTag("packfile").One()
148148
req := packp.NewReferenceUpdateRequest()
149149
req.Commands = []*packp.Command{
150-
{"refs/heads/master", plumbing.ZeroHash, fixture.Head},
150+
{Name: "refs/heads/master", Old: plumbing.ZeroHash, New: fixture.Head},
151151
}
152152
req.Capabilities.Set(capability.ReportStatus)
153153
s.receivePack(c, endpoint, req, fixture, full)
@@ -160,7 +160,7 @@ func (s *ReceivePackSuite) TestFullSendPackOnNonEmpty(c *C) {
160160
fixture := fixtures.Basic().ByTag("packfile").One()
161161
req := packp.NewReferenceUpdateRequest()
162162
req.Commands = []*packp.Command{
163-
{"refs/heads/master", fixture.Head, fixture.Head},
163+
{Name: "refs/heads/master", Old: fixture.Head, New: fixture.Head},
164164
}
165165
s.receivePack(c, endpoint, req, fixture, full)
166166
s.checkRemoteHead(c, endpoint, fixture.Head)
@@ -172,7 +172,7 @@ func (s *ReceivePackSuite) TestSendPackOnNonEmpty(c *C) {
172172
fixture := fixtures.Basic().ByTag("packfile").One()
173173
req := packp.NewReferenceUpdateRequest()
174174
req.Commands = []*packp.Command{
175-
{"refs/heads/master", fixture.Head, fixture.Head},
175+
{Name: "refs/heads/master", Old: fixture.Head, New: fixture.Head},
176176
}
177177
s.receivePack(c, endpoint, req, fixture, full)
178178
s.checkRemoteHead(c, endpoint, fixture.Head)
@@ -184,7 +184,7 @@ func (s *ReceivePackSuite) TestSendPackOnNonEmptyWithReportStatus(c *C) {
184184
fixture := fixtures.Basic().ByTag("packfile").One()
185185
req := packp.NewReferenceUpdateRequest()
186186
req.Commands = []*packp.Command{
187-
{"refs/heads/master", fixture.Head, fixture.Head},
187+
{Name: "refs/heads/master", Old: fixture.Head, New: fixture.Head},
188188
}
189189
req.Capabilities.Set(capability.ReportStatus)
190190

@@ -198,7 +198,7 @@ func (s *ReceivePackSuite) TestSendPackOnNonEmptyWithReportStatusWithError(c *C)
198198
fixture := fixtures.Basic().ByTag("packfile").One()
199199
req := packp.NewReferenceUpdateRequest()
200200
req.Commands = []*packp.Command{
201-
{"refs/heads/master", plumbing.ZeroHash, fixture.Head},
201+
{Name: "refs/heads/master", Old: plumbing.ZeroHash, New: fixture.Head},
202202
}
203203
req.Capabilities.Set(capability.ReportStatus)
204204

@@ -306,7 +306,7 @@ func (s *ReceivePackSuite) testSendPackAddReference(c *C) {
306306

307307
req := packp.NewReferenceUpdateRequest()
308308
req.Commands = []*packp.Command{
309-
{"refs/heads/newbranch", plumbing.ZeroHash, fixture.Head},
309+
{Name: "refs/heads/newbranch", Old: plumbing.ZeroHash, New: fixture.Head},
310310
}
311311
if ar.Capabilities.Supports(capability.ReportStatus) {
312312
req.Capabilities.Set(capability.ReportStatus)
@@ -329,7 +329,7 @@ func (s *ReceivePackSuite) testSendPackDeleteReference(c *C) {
329329

330330
req := packp.NewReferenceUpdateRequest()
331331
req.Commands = []*packp.Command{
332-
{"refs/heads/newbranch", fixture.Head, plumbing.ZeroHash},
332+
{Name: "refs/heads/newbranch", Old: fixture.Head, New: plumbing.ZeroHash},
333333
}
334334
if ar.Capabilities.Supports(capability.ReportStatus) {
335335
req.Capabilities.Set(capability.ReportStatus)

0 commit comments

Comments
 (0)