Skip to content

Commit 29f049a

Browse files
author
Junio C Hamano
committed
Revert "move pack creation to version 3"
This reverts commit 1685457. 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>
1 parent 0a24657 commit 29f049a

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

diff-delta.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ create_delta(const struct delta_index *index,
308308
continue;
309309
if (ref_size > top - src)
310310
ref_size = top - src;
311-
if (ref_size > 0xffffff)
312-
ref_size = 0xffffff;
311+
if (ref_size > 0x10000)
312+
ref_size = 0x10000;
313313
if (ref_size <= msize)
314314
break;
315315
while (ref_size-- && *src++ == *ref)
@@ -318,8 +318,6 @@ create_delta(const struct delta_index *index,
318318
/* this is our best match so far */
319319
msize = ref - entry->ptr;
320320
moff = entry->ptr - ref_data;
321-
if (msize >= 0x10000)
322-
break; /* this is good enough */
323321
}
324322
}
325323

@@ -383,8 +381,6 @@ create_delta(const struct delta_index *index,
383381
if (msize & 0xff) { out[outpos++] = msize; i |= 0x10; }
384382
msize >>= 8;
385383
if (msize & 0xff) { out[outpos++] = msize; i |= 0x20; }
386-
msize >>= 8;
387-
if (msize & 0xff) { out[outpos++] = msize; i |= 0x40; }
388384

389385
*op = i;
390386
}

pack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Packed object header
88
*/
99
#define PACK_SIGNATURE 0x5041434b /* "PACK" */
10-
#define PACK_VERSION 3
10+
#define PACK_VERSION 2
1111
#define pack_version_ok(v) ((v) == htonl(2) || (v) == htonl(3))
1212
struct pack_header {
1313
unsigned int hdr_signature;

0 commit comments

Comments
 (0)