]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/alt-odb-cleanup'
authorJunio C Hamano <gitster@pobox.com>
Mon, 17 Oct 2016 20:25:19 +0000 (13:25 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Oct 2016 20:25:20 +0000 (13:25 -0700)
Codepaths involved in interacting alternate object store have
been cleaned up.

* jk/alt-odb-cleanup:
  alternates: use fspathcmp to detect duplicates
  sha1_file: always allow relative paths to alternates
  count-objects: report alternates via verbose mode
  fill_sha1_file: write into a strbuf
  alternates: store scratch buffer as strbuf
  fill_sha1_file: write "boring" characters
  alternates: use a separate scratch space
  alternates: encapsulate alt->base munging
  alternates: provide helper for allocating alternate
  alternates: provide helper for adding to alternates list
  link_alt_odb_entry: refactor string handling
  link_alt_odb_entry: handle normalize_path errors
  t5613: clarify "too deep" recursion tests
  t5613: do not chdir in main process
  t5613: whitespace/style cleanups
  t5613: use test_must_fail
  t5613: drop test_valid_repo function
  t5613: drop reachable_via function

1  2 
builtin/submodule--helper.c
cache.h
sha1_file.c
sha1_name.c
submodule.c
transport.c

Simple merge
diff --cc cache.h
Simple merge
diff --cc sha1_file.c
Simple merge
diff --cc sha1_name.c
index 3b647fd7cf79127cfa6f684836e387568a87c310,defbb3eb05aa3d82c86549337f9cc56e1f6076bd..409283614679b625f1cb6d191f1a2a32423bbcda
@@@ -100,16 -90,14 +95,14 @@@ static void find_short_object_filename(
        }
        fakeent->next = alt_odb_list;
  
 -      xsnprintf(hex, sizeof(hex), "%.2s", hex_pfx);
 +      xsnprintf(hex, sizeof(hex), "%.2s", ds->hex_pfx);
        for (alt = fakeent; alt && !ds->ambiguous; alt = alt->next) {
+               struct strbuf *buf = alt_scratch_buf(alt);
                struct dirent *de;
                DIR *dir;
-               /*
-                * every alt_odb struct has 42 extra bytes after the base
-                * for exactly this purpose
-                */
-               xsnprintf(alt->name, 42, "%.2s/", ds->hex_pfx);
-               dir = opendir(alt->base);
 -              strbuf_addf(buf, "%.2s/", hex_pfx);
++              strbuf_addf(buf, "%.2s/", ds->hex_pfx);
+               dir = opendir(buf->buf);
                if (!dir)
                        continue;
  
diff --cc submodule.c
Simple merge
diff --cc transport.c
Simple merge