浏览代码

Don't try and send objects if there are none to send (client hung up already)

John Carr 16 年之前
父节点
当前提交
0322de3832
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      dulwich/server.py

+ 5 - 0
dulwich/server.py

@@ -146,6 +146,11 @@ class UploadPackHandler(Handler):
 
 
         graph_walker = ProtocolGraphWalker(self.proto)
         graph_walker = ProtocolGraphWalker(self.proto)
         num_objects, objects_iter = self.backend.fetch_objects(determine_wants, graph_walker, progress)
         num_objects, objects_iter = self.backend.fetch_objects(determine_wants, graph_walker, progress)
+
+        # Do they want any objects?
+        if num_objects == 0:
+            return
+
         progress("dul-daemon says what\n")
         progress("dul-daemon says what\n")
         progress("counting objects: %d, done.\n" % num_objects)
         progress("counting objects: %d, done.\n" % num_objects)
         write_pack_data(ProtocolFile(None, write), objects_iter, num_objects)
         write_pack_data(ProtocolFile(None, write), objects_iter, num_objects)