diff options
author | Junio C Hamano <junkio@cox.net> | 2005-06-26 04:29:18 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-26 07:33:23 -0700 |
commit | 8ee378a0f00a56cbffedee21fdbba30870d84436 (patch) | |
tree | 78600eeaac28aa694b72a70d524b5d0f9839f15c /pack-objects.c | |
parent | d116a45a9a505d9a58cdd1c79193f759316c440d (diff) | |
download | git-8ee378a0f00a56cbffedee21fdbba30870d84436.tar.gz git-8ee378a0f00a56cbffedee21fdbba30870d84436.tar.xz |
[PATCH] Finish initial cut of git-pack-object/git-unpack-object pair.
This finishes the initial round of git-pack-object /
git-unpack-object pair. They are now good enough to be used as
a transport medium:
- Fix delta direction in pack-objects; the original was
computing delta to create the base object from the object to
be squashed, which was quite unfriendly for unpacker ;-).
- Add a script to test the very basics.
- Implement unpacker for both regular and deltified objects.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'pack-objects.c')
-rw-r--r-- | pack-objects.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pack-objects.c b/pack-objects.c index 9d87a64cf..3900df3a2 100644 --- a/pack-objects.c +++ b/pack-objects.c @@ -82,7 +82,8 @@ static void *delta_against(void *buf, unsigned long size, struct object_entry *e if (!otherbuf) die("unable to read %s", sha1_to_hex(entry->delta->sha1)); - delta_buf = diff_delta(buf, size, otherbuf, othersize, &delta_size, ~0UL); + delta_buf = diff_delta(otherbuf, othersize, + buf, size, &delta_size, ~0UL); if (!delta_buf || delta_size != entry->delta_size) die("delta size changed"); free(buf); @@ -318,7 +319,8 @@ static int try_delta(struct unpacked *cur, struct unpacked *old, unsigned max_de max_size = size / 2 - 20; if (cur_entry->delta) max_size = cur_entry->delta_size-1; - delta_buf = diff_delta(cur->data, size, old->data, oldsize, &delta_size, max_size); + delta_buf = diff_delta(old->data, oldsize, + cur->data, size, &delta_size, max_size); if (!delta_buf) return 0; cur_entry->delta = old_entry; |