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

pack.create_delta: correctly encode copy operations up to 2^24 in size

At present we still produce incorrect results for operations larger
than this size. That defect will be fixed in a follow-up to this
change.

Change-Id: Id63b500ae514caa4339063cde2d6486309a8a056
Augie Fackler 11 лет назад
Родитель
Сommit
d5abe9f5a5
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      dulwich/pack.py

+ 1 - 1
dulwich/pack.py

@@ -1627,7 +1627,7 @@ def create_delta(base_buf, target_buf):
                     scratch += chr((copy_start >> i*8) & 0xff)
                     op |= 1 << i
             copy_len = i2 - i1
-            for i in range(2):
+            for i in range(3):
                 if copy_len & 0xff << i*8:
                     scratch += chr((copy_len >> i*8) & 0xff)
                     op |= 1 << (4+i)