Revert "move pack creation to version 3"
This reverts commit 16854571aae6302f457c5fbee41ac64669b09595. Git as recent as v1.1.6 do not understand version 3 delta. v1.2.0 is Ok and I personally would say it is old enough, but the improvement between version 2 and version 3 delta is not bit enough to justify breaking older clients. We should resurrect this later, but when we do so we shold make it conditional. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Oct 14, 2006 at 23:37 UTC
29f049a0c277be72637f74f1f90a89dccd3475bc
2 files changed
+3
-7
diff-delta.c
+2
-6
@@ -308,8 +308,8 @@ create_delta(const struct delta_index *index,
308
continue;
309
if (ref_size > top - src)
310
ref_size = top - src;
311
- if (ref_size > 0xffffff)
312
- ref_size = 0xffffff;
311
+ if (ref_size > 0x10000)
312
+ ref_size = 0x10000;
313
if (ref_size <= msize)
314
break;
315
while (ref_size-- && *src++ == *ref)
@@ -318,8 +318,6 @@ create_delta(const struct delta_index *index,
318
/* this is our best match so far */
319
msize = ref - entry->ptr;
320
moff = entry->ptr - ref_data;
321
- if (msize >= 0x10000)
322
- break; /* this is good enough */
321
}
322
}
323
@@ -383,8 +381,6 @@ create_delta(const struct delta_index *index,
381
if (msize & 0xff) { out[outpos++] = msize; i |= 0x10; }
382
msize >>= 8;
383
if (msize & 0xff) { out[outpos++] = msize; i |= 0x20; }
386
- msize >>= 8;
387
- if (msize & 0xff) { out[outpos++] = msize; i |= 0x40; }
384
385
*op = i;
386
}
pack.h
+1
-1
@@ -7,7 +7,7 @@
7
* Packed object header
8
*/
9
#define PACK_SIGNATURE 0x5041434b /* "PACK" */
10
-#define PACK_VERSION 3
10
+#define PACK_VERSION 2
11
#define pack_version_ok(v) ((v) == htonl(2) || (v) == htonl(3))
12
struct pack_header {
13
unsigned int hdr_signature;