Fix off-by-one
authorJohn Carr <john.carr@unrouted.co.uk>
Wed, 17 Dec 2008 00:39:24 +0000 (00:39 +0000)
committerJohn Carr <john.carr@unrouted.co.uk>
Wed, 17 Dec 2008 00:39:24 +0000 (00:39 +0000)
dulwich/server.py

index e8723adfacf47c17106420558d6e97551aec4b31..6984615c7caeaa64725e943dd3091a70b239b9c1 100644 (file)
@@ -109,7 +109,7 @@ class UploadPackHandler(Handler):
         refs = self.backend.get_refs()
 
         self.write_pkt_line("%s %s\x00multi_ack side-band-64k thin-pack ofs-delta\n" % (refs[0][1], refs[0][0]))
-        for i in range(1, len(refs)-1):
+        for i in range(1, len(refs)):
             ref = refs[i]
             self.write_pkt_line("%s %s\n" % (ref[1], ref[0]))
 
@@ -174,7 +174,7 @@ class ReceivePackHandler(Handler):
         refs = self.backend.get_refs()
 
         self.write_pkt_line("%s %s\x00multi_ack side-band-64k thin-pack ofs-delta\n" % (refs[0][1], refs[0][0]))
-        for i in range(1, len(refs)-1):
+        for i in range(1, len(refs)):
             ref = refs[i]
             self.write_pkt_line("%s %s\n" % (ref[1], ref[0]))