@@ -274,11 +274,21 @@ func (s *ReceivePackSuite) receivePackNoCheck(ep *transport.Endpoint,
274
274
s .Require ().NotNil (info , comment )
275
275
}
276
276
277
- if fixture != nil {
278
- s .Require ().NotNil (fixture .Packfile ())
279
- req .Packfile = fixture .Packfile ()
280
- } else {
281
- req .Packfile = s .emptyPackfile ()
277
+ var needPackfile bool
278
+ for _ , cmd := range req .Commands {
279
+ if cmd .Action () != packp .Delete {
280
+ needPackfile = true
281
+ break
282
+ }
283
+ }
284
+
285
+ if needPackfile {
286
+ if fixture != nil {
287
+ s .Require ().NotNil (fixture .Packfile ())
288
+ req .Packfile = fixture .Packfile ()
289
+ } else {
290
+ req .Packfile = s .emptyPackfile ()
291
+ }
282
292
}
283
293
284
294
return conn .Push (ctx , req )
@@ -370,9 +380,6 @@ func (s *ReceivePackSuite) testSendPackAddReference() {
370
380
{Name : "refs/heads/newbranch" , Old : plumbing .ZeroHash , New : plumbing .NewHash (fixture .Head )},
371
381
},
372
382
}
373
- // if refs.Capabilities.Supports(capability.ReportStatus) {
374
- // req.Capabilities.Set(capability.ReportStatus)
375
- // }
376
383
377
384
s .receivePack (s .Endpoint , req , fixture , false )
378
385
s .checkRemoteReference (s .Endpoint , "refs/heads/newbranch" , plumbing .NewHash (fixture .Head ))
@@ -400,9 +407,6 @@ func (s *ReceivePackSuite) testSendPackDeleteReference() {
400
407
{Name : "refs/heads/newbranch" , Old : plumbing .NewHash (fixture .Head ), New : plumbing .ZeroHash },
401
408
},
402
409
}
403
- // if refs.Capabilities.Supports(capability.ReportStatus) {
404
- // req.Capabilities.Set(capability.ReportStatus)
405
- // }
406
410
407
411
if ! caps .Supports (capability .DeleteRefs ) {
408
412
s .Fail ("capability delete-refs not supported" )
0 commit comments