diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2013-09-24 23:29:55 -0700 |
---|---|---|
committer | Jonathan Nieder <jrnieder@gmail.com> | 2013-09-24 23:29:55 -0700 |
commit | 87bcf148d7a2dd585bbb6ed18dae83a42b45a67a (patch) | |
tree | d77cf2b6b419d3d28771852978585be36f84a8a0 /sha1_file.c | |
parent | Merge branch 'jk/shortlog-tolerate-broken-commit' (diff) | |
parent | pack-objects: no crc check when the cached version is used (diff) | |
download | tgif-87bcf148d7a2dd585bbb6ed18dae83a42b45a67a.tar.xz |
Merge branch 'nd/unpack-entry-optim-in-pack-objects'
* nd/unpack-entry-optim-in-pack-objects:
pack-objects: no crc check when the cached version is used
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sha1_file.c b/sha1_file.c index f1b649742f..f80bbe4674 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -2126,6 +2126,16 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset, int i; struct delta_base_cache_entry *ent; + ent = get_delta_base_cache_entry(p, curpos); + if (eq_delta_base_cache_entry(ent, p, curpos)) { + type = ent->type; + data = ent->data; + size = ent->size; + clear_delta_base_cache_entry(ent); + base_from_cache = 1; + break; + } + if (do_check_packed_object_crc && p->index_version > 1) { struct revindex_entry *revidx = find_pack_revindex(p, obj_offset); unsigned long len = revidx[1].offset - obj_offset; @@ -2140,16 +2150,6 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset, } } - ent = get_delta_base_cache_entry(p, curpos); - if (eq_delta_base_cache_entry(ent, p, curpos)) { - type = ent->type; - data = ent->data; - size = ent->size; - clear_delta_base_cache_entry(ent); - base_from_cache = 1; - break; - } - type = unpack_object_header(p, &w_curs, &curpos, &size); if (type != OBJ_OFS_DELTA && type != OBJ_REF_DELTA) break; |