]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'rs/tempfile-wo-the-repository'
authorJunio C Hamano <gitster@pobox.com>
Thu, 30 Jul 2026 17:32:02 +0000 (10:32 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Jul 2026 17:32:02 +0000 (10:32 -0700)
The tempfile and lockfile APIs have been refactored to stop depending
on the 'the_repository' global variable, and their callers have been
updated to use the repository-aware variants.

* rs/tempfile-wo-the-repository:
  use repo_hold_lock_file_for_update{,_mode,_timeout}() with custom repos
  tempfile: stop using the_repository
  lockfile: add repo_hold_lock_file_for_update{,_timeout}{,_mode}()
  refs/packed: use repo_create_tempfile()
  tempfile: add repo_create_tempfile{,_mode}()

14 files changed:
1  2 
apply.c
builtin/difftool.c
builtin/gc.c
builtin/history.c
commit-graph.c
config.c
loose.c
midx-write.c
odb/source-files.c
refs/files-backend.c
refs/packed-backend.c
repack-midx.c
repository.c
rerere.c

diff --cc apply.c
Simple merge
Simple merge
diff --cc builtin/gc.c
Simple merge
Simple merge
diff --cc commit-graph.c
Simple merge
diff --cc config.c
Simple merge
diff --cc loose.c
Simple merge
diff --cc midx-write.c
Simple merge
Simple merge
Simple merge
index c5d96793fa5841efca309df4e177ac8b497b03b9,117f2d43681a6b0ce171247240caeb49f56236b4..b9b04b70105f9a55135a5854a9b46577d0493203
@@@ -1252,10 -1232,9 +1252,9 @@@ int packed_refs_lock(struct ref_store *
         * don't write new content to it, but rather to a separate
         * tempfile.
         */
-       if (hold_lock_file_for_update_timeout(
-                           &refs->lock,
-                           refs->path,
-                           flags, refs->timeout_value) < 0) {
+       if (repo_hold_lock_file_for_update_timeout(ref_store->repo, &refs->lock,
+                                                  refs->path, flags,
 -                                                 timeout_value) < 0) {
++                                                 refs->timeout_value) < 0) {
                unable_to_lock_message(refs->path, errno, err);
                return -1;
        }
diff --cc repack-midx.c
Simple merge
diff --cc repository.c
Simple merge
diff --cc rerere.c
Simple merge