From: Junio C Hamano Date: Wed, 11 Apr 2018 04:09:55 +0000 (+0900) Subject: Merge branch 'sb/packfiles-in-repository' X-Git-Tag: v2.18.0-rc0~143 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/3a1ec60c43b1cad73fed8040aed7117900e9fd9d?ds=inline;hp=--cc Merge branch 'sb/packfiles-in-repository' Refactoring of the internal global data structure continues. * sb/packfiles-in-repository: packfile: keep prepare_packed_git() private packfile: allow find_pack_entry to handle arbitrary repositories packfile: add repository argument to find_pack_entry packfile: allow reprepare_packed_git to handle arbitrary repositories packfile: allow prepare_packed_git to handle arbitrary repositories packfile: allow prepare_packed_git_one to handle arbitrary repositories packfile: add repository argument to reprepare_packed_git packfile: add repository argument to prepare_packed_git packfile: add repository argument to prepare_packed_git_one packfile: allow install_packed_git to handle arbitrary repositories packfile: allow rearrange_packed_git to handle arbitrary repositories packfile: allow prepare_packed_git_mru to handle arbitrary repositories --- 3a1ec60c43b1cad73fed8040aed7117900e9fd9d diff --cc bulk-checkin.c index e5ce2a7954,eadc2d5172..de1f4040c7 --- a/bulk-checkin.c +++ b/bulk-checkin.c @@@ -57,10 -58,10 +58,10 @@@ clear_exit strbuf_release(&packname); /* Make objects we just wrote available to ourselves */ - reprepare_packed_git(); + reprepare_packed_git(the_repository); } -static int already_written(struct bulk_checkin_state *state, unsigned char sha1[]) +static int already_written(struct bulk_checkin_state *state, struct object_id *oid) { int i; diff --cc sha1_file.c index aab3b58e03,314ff55b47..77ccaab928 --- a/sha1_file.c +++ b/sha1_file.c @@@ -1268,22 -1266,17 +1268,22 @@@ int oid_object_info_extended(const stru } while (1) { - if (find_pack_entry(real->hash, &e)) - if (find_pack_entry(the_repository, real, &e)) ++ if (find_pack_entry(the_repository, real->hash, &e)) break; + if (flags & OBJECT_INFO_IGNORE_LOOSE) + return -1; + /* Most likely it's a loose object. */ - if (!sha1_loose_object_info(the_repository, real, oi, flags)) + if (!sha1_loose_object_info(the_repository, real->hash, oi, flags)) return 0; /* Not a loose object; someone else may have just packed it. */ - reprepare_packed_git(the_repository); - if (find_pack_entry(the_repository, real, &e)) - break; + if (!(flags & OBJECT_INFO_QUICK)) { - reprepare_packed_git(); - if (find_pack_entry(real->hash, &e)) ++ reprepare_packed_git(the_repository); ++ if (find_pack_entry(the_repository, real->hash, &e)) + break; + } /* Check if it is a missing object */ if (fetch_if_missing && repository_format_partial_clone &&