From: Dave Borowitz Date: Wed, 10 Mar 2010 20:36:51 +0000 (-0800) Subject: Strip excess whitespace from capabilities lines. X-Git-Tag: dulwich-0.6.0~28^2~4 X-Git-Url: http://git.samba.org/samba.git/?p=jelmer%2Fdulwich-libgit2.git;a=commitdiff_plain;h=0a9928f765474cec1a79ff11072bd5d69fa9fccb 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 --- diff --git a/dulwich/protocol.py b/dulwich/protocol.py index 5525f62..e72b9e0 100644 --- a/dulwich/protocol.py +++ b/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):