Skip to content

Commit

Permalink
fix index-pack with packs >4GB containing deltas on 32-bit machines
Browse files Browse the repository at this point in the history
This probably hasn't been properly tested before.  Here's a script to
create a 8GB repo with the necessary characteristics (copy the
test-genrandom executable from the Git build tree to /tmp first):

-----
#!/bin/bash

git init
git config core.compression 0

# create big objects with no deltas
for i in $(seq -w 1 2 63)
do
	echo $i
	/tmp/test-genrandom $i 268435456 > file_$i
	git add file_$i
	rm file_$i
	echo "file_$i -delta" >> .gitattributes
done

# create "deltifiable" objects in between big objects
for i in $(seq -w 2 2 64)
do
	echo "$i $i $i" >> grow
	cp grow file_$i
	git add file_$i
	rm file_$i
done
rm grow

# create a pack with them
git commit -q -m "commit of big objects interlaced with small deltas"
git repack -a -d
-----

Then clone this repo over the Git protocol.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nicolas Pitre authored and Junio C Hamano committed Nov 11, 2007
1 parent ff350cc commit a91ef6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static void *unpack_raw_entry(struct object_entry *obj, union delta_base *delta_

static void *get_data_from_pack(struct object_entry *obj)
{
unsigned long from = obj[0].idx.offset + obj[0].hdr_size;
off_t from = obj[0].idx.offset + obj[0].hdr_size;
unsigned long len = obj[1].idx.offset - from;
unsigned long rdy = 0;
unsigned char *src, *data;
Expand Down

0 comments on commit a91ef6e

Please sign in to comment.