From: Junio C Hamano Date: Mon, 15 Jun 2026 14:42:00 +0000 (-0700) Subject: Merge branch 'ob/more-repo-config-values' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=883a47ef6496c96a5d6132ed8c87fcd44ebf8d1a;p=thirdparty%2Fgit.git Merge branch 'ob/more-repo-config-values' 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` --- 883a47ef6496c96a5d6132ed8c87fcd44ebf8d1a diff --cc builtin/sparse-checkout.c index d89acbeb53,92d017b81f..0863d0fb46 --- a/builtin/sparse-checkout.c +++ b/builtin/sparse-checkout.c @@@ -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, diff --cc object-file.c index bce941874e,37def5cc59..9afa842da2 --- a/object-file.c +++ b/object-file.c @@@ -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;