Sfoglia il codice sorgente

server: Prevent errors

Jelmer Vernooij 1 mese fa
parent
commit
8d60c42315
1 ha cambiato i file con 6 aggiunte e 2 eliminazioni
  1. 6 2
      dulwich/server.py

+ 6 - 2
dulwich/server.py

@@ -397,8 +397,6 @@ class UploadPackHandler(PackHandler):
             get_tagged=self.get_tagged,
         )
 
-        object_ids = list(missing_objects)
-
         # Did the process short-circuit (e.g. in a stateless RPC call)? Note
         # that the client still expects a 0-object pack in most cases.
         # Also, if it also happens that the object_iter is instantiated
@@ -408,6 +406,12 @@ class UploadPackHandler(PackHandler):
         if len(wants) == 0:
             return
 
+        # Handle shallow clone case where missing_objects can be None
+        if missing_objects is None:
+            return
+
+        object_ids = list(missing_objects)
+
         if not graph_walker.handle_done(
             not self.has_capability(CAPABILITY_NO_DONE), self._done_received
         ):