瀏覽代碼

Strip excess whitespace from capabilities lines.

C git separates client capabilities during send-pack with both \0 and a
space, so we need to handle that as well. This change is significantly
more lenient, but the cgit behavior is not well-documented, so there may
be more corner cases. It's hard to imagine that the extra strip() will
actually result in capabilities lists being parsed incorrectly.

Change-Id: I74b734e146add683b4c1e4ea6b575f458ec25de7
Dave Borowitz 15 年之前
父節點
當前提交
c3d292e99d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      dulwich/protocol.py

+ 1 - 1
dulwich/protocol.py

@@ -171,7 +171,7 @@ def extract_capabilities(text):
     if not "\0" in text:
         return text, []
     text, capabilities = text.rstrip().split("\0")
-    return (text, capabilities.split(" "))
+    return (text, capabilities.strip().split(" "))
 
 
 def extract_want_line_capabilities(text):