From: Junio C Hamano Date: Mon, 27 Jul 2026 16:08:59 +0000 (-0700) Subject: Merge branch 'ps/refs-wo-the-repository' X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=0c20b0863149755dd1936dade25b59dfc6e8c34d;p=thirdparty%2Fgit.git Merge branch 'ps/refs-wo-the-repository' The ref subsystem and the worktree API have been refactored to pass a repository pointer down the call chain, allowing them to drop references to the global 'the_repository' variable. As part of this, the handling of the 'core.packedRefsTimeout' configuration has been moved into the per-repository ref store structure. * ps/refs-wo-the-repository: refs: remove remaining uses of `the_repository` worktree: pass repository to public functions worktree: pass repository to file-local functions worktree: refactor code to use available repositories refs/files: drop `USE_THE_REPOSITORY_VARIABLE` refs/packed: de-globalize handling of "core.packedRefsTimeout" --- 0c20b0863149755dd1936dade25b59dfc6e8c34d diff --cc refs/files-backend.c index e1d963a6f3,09e1be838a..3ba1b4eac4 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@@ -857,7 -859,7 +859,7 @@@ retry } else { unable_to_lock_message(ref_file.buf, myerr, err); if (myerr == EEXIST) { - if (repo_ignore_case(the_repository) && - if (ignore_case && ++ if (repo_ignore_case(refs->base.repo) && transaction_has_case_conflicting_update(transaction, update)) { /* * In case-insensitive filesystems, ensure that conflicts within a @@@ -971,7 -973,7 +973,7 @@@ * conflicts between 'foo' and 'Foo/bar'. So let's lowercase * the refname. */ - if (repo_ignore_case(the_repository)) { - if (ignore_case) { ++ if (repo_ignore_case(refs->base.repo)) { struct strbuf lower = STRBUF_INIT; strbuf_addstr(&lower, refname); diff --cc setup.c index d31808130b,505e8d7bf2..e4cb5d1925 --- a/setup.c +++ b/setup.c @@@ -2847,16 -2822,15 +2848,16 @@@ int init_db(struct repository *repo if (!exist_ok && !stat(real_git_dir, &st)) die(_("%s already exists"), real_git_dir); - set_git_dir(repo, real_git_dir, 1); + apply_and_export_relative_gitdir(repo, real_git_dir, 1); git_dir = repo_get_git_dir(repo); - separate_git_dir(git_dir, original_git_dir); + separate_git_dir(repo, git_dir, original_git_dir); - } - else { - set_git_dir(repo, git_dir, 1); + } else { + apply_and_export_relative_gitdir(repo, git_dir, 1); git_dir = repo_get_git_dir(repo); } - startup_info->have_repository = 1; + + if (worktree) + set_git_work_tree(repo, worktree); /* * Check to see if the repository version is right.