]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ps/refs-wo-the-repository'
authorJunio C Hamano <gitster@pobox.com>
Mon, 27 Jul 2026 16:08:59 +0000 (09:08 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Jul 2026 16:08:59 +0000 (09:08 -0700)
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"

1  2 
builtin/branch.c
builtin/receive-pack.c
builtin/worktree.c
reachable.c
refs/files-backend.c
revision.c
setup.c
submodule.c

Simple merge
Simple merge
Simple merge
diff --cc reachable.c
Simple merge
index e1d963a6f359b803b679f348e51278bdd8c9f036,09e1be838a98a6b86b20f0867ab318414f6da791..3ba1b4eac4a44a2a29c34c7dd7ced7c4e692ffec
@@@ -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
                 * 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 revision.c
Simple merge
diff --cc setup.c
index d31808130b47fcb610a6f1c90cff58c9ccfc492b,505e8d7bf20bda6fc8f580024a5ef37360d34aa1..e4cb5d19258935e21c824808c653ba3fff1bc516
+++ 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.
diff --cc submodule.c
Simple merge