aboutsummaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-21 22:38:43 -0800
committerJunio C Hamano <junkio@cox.net>2006-02-21 22:38:43 -0800
commit155d12912fec6c60ead6d6c1febda5fa6e6eb128 (patch)
treecfa9a9521b6d1510cf76ff0fe1b708b30e81412f /sha1_file.c
parentee072260dbff6914c24d956bcc2d46882831f1a0 (diff)
parente4c9327a77bd59e85d4b17a612e78977d68773ee (diff)
downloadgit-155d12912fec6c60ead6d6c1febda5fa6e6eb128.tar.gz
git-155d12912fec6c60ead6d6c1febda5fa6e6eb128.tar.xz
Merge branch 'jc/pack-reuse'
* jc/pack-reuse: pack-objects: avoid delta chains that are too long. git-repack: allow passing a couple of flags to pack-objects. pack-objects: finishing touches. pack-objects: reuse data from existing packs.
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 1d799f793..9cab99ae7 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -828,6 +828,25 @@ static unsigned long unpack_object_header(struct packed_git *p, unsigned long of
return offset;
}
+int check_reuse_pack_delta(struct packed_git *p, unsigned long offset,
+ unsigned char *base, unsigned long *sizep,
+ enum object_type *kindp)
+{
+ unsigned long ptr;
+ int status = -1;
+
+ use_packed_git(p);
+ ptr = offset;
+ ptr = unpack_object_header(p, ptr, kindp, sizep);
+ if (*kindp != OBJ_DELTA)
+ goto done;
+ memcpy(base, p->pack_base + ptr, 20);
+ status = 0;
+ done:
+ unuse_packed_git(p);
+ return status;
+}
+
void packed_object_info_detail(struct pack_entry *e,
char *type,
unsigned long *size,