Просмотр исходного кода

UploadPackHandler must return if objects_iter is empty

objects_iter is not None if client does not want any refs.
This patch avoids UploadPackHandler to continue pack creation and raise
GitProtocolError "Server attempts to access capability before
asking client".

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Fabien Boucher 12 лет назад
Родитель
Сommit
040f33b23c
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      dulwich/server.py

+ 1 - 1
dulwich/server.py

@@ -277,7 +277,7 @@ class UploadPackHandler(Handler):
 
 
         # Did the process short-circuit (e.g. in a stateless RPC call)? Note
         # 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.
         # that the client still expects a 0-object pack in most cases.
-        if objects_iter is None:
+        if len(objects_iter) == 0:
             return
             return
 
 
         self.progress("dul-daemon says what\n")
         self.progress("dul-daemon says what\n")