From 09f5f2a35f0f4c42b2def0642540f32e59fdeeb3 Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Mon, 10 Jul 2017 18:25:28 +0200 Subject: improve delete support on push * server: implement delete-refs and announce it. * remote: check if server announced delete-refs before trying to delete and fail fast if it does not. Note that the client does not need no send 'delete-refs' back to the server to be able to delete references: ``` delete-refs ----------- If the server sends back the 'delete-refs' capability, it means that it is capable of accepting a zero-id value as the target value of a reference update. It is not sent back by the client, it simply informs the client that it can be sent zero-id values to delete references. ``` So our server implementation does not check if the client sent delete-refs back, it just accepts deletes if it receives them. --- plumbing/transport/test/receive_pack.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plumbing/transport/test') diff --git a/plumbing/transport/test/receive_pack.go b/plumbing/transport/test/receive_pack.go index bb1c58a..15172c8 100644 --- a/plumbing/transport/test/receive_pack.go +++ b/plumbing/transport/test/receive_pack.go @@ -308,6 +308,10 @@ func (s *ReceivePackSuite) testSendPackDeleteReference(c *C) { req.Capabilities.Set(capability.ReportStatus) } + if !ar.Capabilities.Supports(capability.DeleteRefs) { + c.Fatal("capability delete-refs not supported") + } + c.Assert(r.Close(), IsNil) s.receivePack(c, s.Endpoint, req, nil, false) -- cgit