summaryrefslogtreecommitdiff
path: root/diff-delta.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2006-09-21 04:11:59 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-09-23 02:24:52 (GMT)
commit16854571aae6302f457c5fbee41ac64669b09595 (patch)
treead636b706b3f8ee8beb8ebbbf762016f3d0454c5 /diff-delta.c
parent3d5c0cc9387b35df47c988fbc0e4379e413d783e (diff)
downloadgit-16854571aae6302f457c5fbee41ac64669b09595.zip
git-16854571aae6302f457c5fbee41ac64669b09595.tar.gz
git-16854571aae6302f457c5fbee41ac64669b09595.tar.bz2
move pack creation to version 3
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>
Diffstat (limited to 'diff-delta.c')
-rw-r--r--diff-delta.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/diff-delta.c b/diff-delta.c
index fa16d06..51df460 100644
--- a/diff-delta.c
+++ b/diff-delta.c
@@ -308,8 +308,8 @@ create_delta(const struct delta_index *index,
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)
@@ -318,6 +318,8 @@ create_delta(const struct delta_index *index,
/* this is our best match so far */
msize = ref - entry->ptr;
moff = entry->ptr - ref_data;
+ if (msize >= 0x10000)
+ break; /* this is good enough */
}
}
@@ -381,6 +383,8 @@ create_delta(const struct delta_index *index,
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;
}