]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ob/more-repo-config-values' into jch
authorJunio C Hamano <gitster@pobox.com>
Wed, 3 Jun 2026 23:13:59 +0000 (08:13 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Jun 2026 23:13:59 +0000 (08:13 +0900)
Many core configuration variables have been migrated from global
variables into 'repo_config_values' to tie them to a specific
repository instance, avoiding cross-repository state leakage.

* ob/more-repo-config-values:
  environment: move "warn_on_object_refname_ambiguity" into `struct repo_config_values`
  environment: move "sparse_expect_files_outside_of_patterns" into `struct repo_config_values`
  environment: move "core_sparse_checkout_cone" into `struct repo_config_values`
  environment: move "precomposed_unicode" into `struct repo_config_values`
  environment: move "pack_compression_level" into `struct repo_config_values`
  environment: move `zlib_compression_level` into `struct repo_config_values`
  environment: move "check_stat" into `struct repo_config_values`
  environment: move "trust_ctime" into `struct repo_config_values`

15 files changed:
1  2 
builtin/cat-file.c
builtin/index-pack.c
builtin/mv.c
builtin/pack-objects.c
builtin/sparse-checkout.c
compat/precompose_utf8.c
diff.c
dir.c
environment.h
http-push.c
object-file.c
object-name.c
revision.c
submodule.c
upload-pack.c

Simple merge
Simple merge
diff --cc builtin/mv.c
Simple merge
Simple merge
index d89acbeb533bd80e49e7a0ed8dabd9e13fc112eb,92d017b81f9a327b4ea77436c422b1609602b8c1..0863d0fb460cf80bdbce6bcc270bd25eb81a557b
@@@ -975,10 -980,10 +981,10 @@@ static int sparse_checkout_clean(int ar
                OPT_END(),
        };
  
 -      setup_work_tree();
 +      setup_work_tree(the_repository);
        if (!cfg->apply_sparse_checkout)
                die(_("must be in a sparse-checkout to clean directories"));
-       if (!core_sparse_checkout_cone)
+       if (!cfg->core_sparse_checkout_cone)
                die(_("must be in a cone-mode sparse-checkout to clean directories"));
  
        argc = parse_options(argc, argv, prefix,
Simple merge
diff --cc diff.c
Simple merge
diff --cc dir.c
Simple merge
diff --cc environment.h
Simple merge
diff --cc http-push.c
Simple merge
diff --cc object-file.c
index bce941874eb994c8dbaf391ede6c84a09fa96f56,37def5cc5907841418b2294a87950189d8ada125..9afa842da2dc8e002011c4e99955348df7839112
@@@ -659,11 -903,12 +659,12 @@@ static int start_loose_object_common(st
                                     struct git_hash_ctx *c, struct git_hash_ctx *compat_c,
                                     char *hdr, int hdrlen)
  {
 -      const struct git_hash_algo *algo = source->odb->repo->hash_algo;
 -      const struct git_hash_algo *compat = source->odb->repo->compat_hash_algo;
 +      const struct git_hash_algo *algo = loose->base.odb->repo->hash_algo;
 +      const struct git_hash_algo *compat = loose->base.odb->repo->compat_hash_algo;
        int fd;
+       struct repo_config_values *cfg = repo_config_values(the_repository);
  
 -      fd = create_tmpfile(source->odb->repo, tmp_file, filename);
 +      fd = create_tmpfile(loose->base.odb->repo, tmp_file, filename);
        if (fd < 0) {
                if (flags & ODB_WRITE_OBJECT_SILENT)
                        return -1;
@@@ -1175,9 -1435,11 +1176,10 @@@ static void stream_blob_to_pack(struct 
        unsigned char obuf[16384];
        unsigned hdrlen;
        int status = Z_OK;
 -      int write_object = (flags & INDEX_WRITE_OBJECT);
 -      off_t offset = 0;
+       struct repo_config_values *cfg = repo_config_values(the_repository);
 +      size_t bytes_read = 0;
  
-       git_deflate_init(&s, pack_compression_level);
+       git_deflate_init(&s, cfg->pack_compression_level);
  
        hdrlen = encode_in_pack_object_header(obuf, sizeof(obuf), OBJ_BLOB, size);
        s.next_out = obuf + hdrlen;
diff --cc object-name.c
Simple merge
diff --cc revision.c
Simple merge
diff --cc submodule.c
Simple merge
diff --cc upload-pack.c
Simple merge