Dulwich.io dulwich / e793038
Check for empty-repo on client fetch An empty repo will respond with the flush-pkt only. Signed-off-by: Jelmer Vernooij <jelmer@samba.org> milki authored 6 years ago Jelmer Vernooij committed 6 years ago
2 changed file(s) with 13 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
168168 if server_capabilities is None:
169169 (ref, server_capabilities) = extract_capabilities(ref)
170170 refs[ref] = sha
171
172 if len(refs) == 0:
173 return None, set([])
171174 return refs, set(server_capabilities)
172175
173176 def send_pack(self, path, determine_wants, generate_pack_contents,
468471 proto, can_read = self._connect('upload-pack', path)
469472 refs, server_capabilities = self._read_refs(proto)
470473 negotiated_capabilities = self._fetch_capabilities & server_capabilities
474
475 if refs is None:
476 proto.write_pkt_line(None)
477 return refs
478
471479 try:
472480 wants = determine_wants(refs)
473481 except:
7777 self.client.archive('bla', 'HEAD', None, None)
7878 self.assertEqual(self.rout.getvalue(), '0011argument HEAD0000')
7979
80 def test_fetch_empty(self):
81 self.rin.write('0000')
82 self.rin.seek(0)
83 self.client.fetch_pack('/', lambda heads: [], None, None)
84
8085 def test_fetch_pack_none(self):
8186 self.rin.write(
8287 '008855dcc6bf963f922e1ed5c4bbaaefcfacef57b1d7 HEAD.multi_ack '