Merge branch 'jk/loose-object-cache'
authorJunio C Hamano <gitster@pobox.com>
Fri, 4 Jan 2019 21:33:32 +0000 (13:33 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 4 Jan 2019 21:33:32 +0000 (13:33 -0800)
Code clean-up with optimization for the codepath that checks
(non-)existence of loose objects.

* jk/loose-object-cache:
odb_load_loose_cache: fix strbuf leak
fetch-pack: drop custom loose object cache
sha1-file: use loose object cache for quick existence check
object-store: provide helpers for loose_objects_cache
sha1-file: use an object_directory for the main object dir
handle alternates paths the same as the main object dir
sha1_file_name(): overwrite buffer instead of appending
rename "alternate_object_database" to "object_directory"
submodule--helper: prefer strip_suffix() to ends_with()
fsck: do not reuse child_process structs

1  2 
builtin/fsck.c
builtin/grep.c
builtin/submodule--helper.c
environment.c
fetch-pack.c
http.c
midx.c
packfile.c
path.c
sha1-file.c
diff --cc builtin/fsck.c
Simple merge
diff --cc builtin/grep.c
index 71df52a333cbc756b057e93bf3d2affca8157860,714c8d91bab9ea32c4646b5e4366805cdb8c1fab..bad9c0a3d5134a69d9388e169793b03c9952d9bf
@@@ -437,7 -440,8 +437,7 @@@ static int grep_submodule(struct grep_o
         * store is no longer global and instead is a member of the repository
         * object.
         */
-       add_to_alternates_memory(submodule.objects->objectdir);
 -      grep_read_lock();
+       add_to_alternates_memory(submodule.objects->odb->path);
        grep_read_unlock();
  
        if (oid) {
Simple merge
diff --cc environment.c
Simple merge
diff --cc fetch-pack.c
Simple merge
diff --cc http.c
Simple merge
diff --cc midx.c
index 2a6a24fcd7eff1a074c37e6c556f2143ef134c19,4fac0cd08ab9b2a78096c57518d2ea8cd1db96a2..8a505fd423efccf9986079542b47967cc93df7dc
--- 1/midx.c
--- 2/midx.c
+++ b/midx.c
@@@ -929,14 -914,9 +929,14 @@@ cleanup
        return 0;
  }
  
 -void clear_midx_file(const char *object_dir)
 +void clear_midx_file(struct repository *r)
  {
-       char *midx = get_midx_filename(r->objects->objectdir);
 -      char *midx = get_midx_filename(object_dir);
++      char *midx = get_midx_filename(r->objects->odb->path);
 +
 +      if (r->objects && r->objects->multi_pack_index) {
 +              close_midx(r->objects->multi_pack_index);
 +              r->objects->multi_pack_index = NULL;
 +      }
  
        if (remove_path(midx)) {
                UNLEAK(midx);
diff --cc packfile.c
Simple merge
diff --cc path.c
Simple merge
diff --cc sha1-file.c
Simple merge