summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3d5c0cc)
raw | patch | inline | side by side (parent: 3d5c0cc)
author | Nicolas Pitre <nico@cam.org> | |
Thu, 21 Sep 2006 04:11:59 +0000 (00:11 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 23 Sep 2006 02:24:52 +0000 (19:24 -0700) |
It's been quite a while now that GIT is able to read version 3 packs.
Let's create them at last.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Let's create them at last.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff-delta.c | patch | blob | history | |
pack.h | patch | blob | history |
diff --git a/diff-delta.c b/diff-delta.c
index fa16d06c8d1e85a458428c673cb2f589857f5424..51df4608a8186e519bcb3b4e67d421c18efb696a 100644 (file)
--- a/diff-delta.c
+++ b/diff-delta.c
continue;
if (ref_size > top - src)
ref_size = top - src;
- if (ref_size > 0x10000)
- ref_size = 0x10000;
+ if (ref_size > 0xffffff)
+ ref_size = 0xffffff;
if (ref_size <= msize)
break;
while (ref_size-- && *src++ == *ref)
/* this is our best match so far */
msize = ref - entry->ptr;
moff = entry->ptr - ref_data;
+ if (msize >= 0x10000)
+ break; /* this is good enough */
}
}
if (msize & 0xff) { out[outpos++] = msize; i |= 0x10; }
msize >>= 8;
if (msize & 0xff) { out[outpos++] = msize; i |= 0x20; }
+ msize >>= 8;
+ if (msize & 0xff) { out[outpos++] = msize; i |= 0x40; }
*op = i;
}
index eb07b033ae54941d4bd00ee6bc30c7d50fd039b0..05557da1528e3185cf4d7d89a6577beb8f9e95ad 100644 (file)
--- a/pack.h
+++ b/pack.h
* Packed object header
*/
#define PACK_SIGNATURE 0x5041434b /* "PACK" */
-#define PACK_VERSION 2
+#define PACK_VERSION 3
#define pack_version_ok(v) ((v) == htonl(2) || (v) == htonl(3))
struct pack_header {
unsigned int hdr_signature;