Merge branch 'sb/packfiles-in-repository'
authorJunio C Hamano <gitster@pobox.com>
Wed, 11 Apr 2018 04:09:55 +0000 (13:09 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Apr 2018 04:09:55 +0000 (13:09 +0900)
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

13 files changed:
1  2 
builtin/fsck.c
builtin/gc.c
builtin/pack-objects.c
builtin/pack-redundant.c
builtin/receive-pack.c
bulk-checkin.c
fast-import.c
fetch-pack.c
http.c
packfile.c
packfile.h
sha1_file.c
sha1_name.c
diff --cc builtin/fsck.c
Simple merge
diff --cc builtin/gc.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc bulk-checkin.c
index e5ce2a795433b5d369cf5a03aaa7d35694ae81fd,eadc2d5172052878c2b9276313cef752baedd839..de1f4040c788f683a0cca3695c10b163811dd945
@@@ -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 fast-import.c
Simple merge
diff --cc fetch-pack.c
Simple merge
diff --cc http.c
Simple merge
diff --cc packfile.c
Simple merge
diff --cc packfile.h
Simple merge
diff --cc sha1_file.c
index aab3b58e0330531efa8a442eafb18840b1f212f3,314ff55b4769a4262a76e3fa4c639f7d9c9f4b88..77ccaab928529d37aa971168c54e31358e12ef8e
@@@ -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 &&
diff --cc sha1_name.c
Simple merge