]> source.dussan.org Git - jgit.git/commitdiff
Properly parse first line in ReceivePack with no '\0' 11/5411/1
authorDave Borowitz <dborowitz@google.com>
Fri, 23 Mar 2012 21:38:06 +0000 (14:38 -0700)
committerDave Borowitz <dborowitz@google.com>
Fri, 23 Mar 2012 21:38:06 +0000 (14:38 -0700)
Change-Id: Ic98e17aff4e4b3c3fa0359082bab689e4522e3d7

org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java

index 81c44ae322f9f8cc71c8da4e979f45ebb043fa5b..126d74fc3736801de96d33e3ab020f7ea64dad62 100644 (file)
@@ -115,8 +115,9 @@ public class ReceivePack {
                        if (nul >= 0) {
                                for (String c : line.substring(nul + 1).split(" "))
                                        caps.add(c);
-                       }
-                       this.line = line.substring(0, nul);
+                               this.line = line.substring(0, nul);
+                       } else
+                               this.line = line;
                        this.capabilities = Collections.unmodifiableSet(caps);
                }