diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-10-10 23:03:46 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-10 23:03:47 +0200 |
commit | e6e24c94df9df6d39f2316113c14fe07d2ab03d7 (patch) | |
tree | 1f883be2ac3f3a84ce5af3cd1e9e32c45648e21e /builtin/cat-file.c | |
parent | Merge branch 'rs/qsort' (diff) | |
parent | pack-objects: use mru list when iterating over packs (diff) | |
download | git-e6e24c94df9df6d39f2316113c14fe07d2ab03d7.tar.xz git-e6e24c94df9df6d39f2316113c14fe07d2ab03d7.zip |
Merge branch 'jk/pack-objects-optim-mru'
"git pack-objects" in a repository with many packfiles used to
spend a lot of time looking for/at objects in them; the accesses to
the packfiles are now optimized by checking the most-recently-used
packfile first.
* jk/pack-objects-optim-mru:
pack-objects: use mru list when iterating over packs
pack-objects: break delta cycles before delta-search phase
sha1_file: make packed_object_info public
provide an initializer for "struct object_info"
Diffstat (limited to 'builtin/cat-file.c')
-rw-r--r-- | builtin/cat-file.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c index cca97a86c0..30383e9eb4 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -53,7 +53,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name, char *buf; unsigned long size; struct object_context obj_context; - struct object_info oi = {NULL}; + struct object_info oi = OBJECT_INFO_INIT; struct strbuf sb = STRBUF_INIT; unsigned flags = LOOKUP_REPLACE_OBJECT; const char *path = force_path; @@ -449,8 +449,7 @@ static int batch_objects(struct batch_options *opt) data.split_on_whitespace = 1; if (opt->all_objects) { - struct object_info empty; - memset(&empty, 0, sizeof(empty)); + struct object_info empty = OBJECT_INFO_INIT; if (!memcmp(&data.info, &empty, sizeof(empty))) data.skip_object_info = 1; } |