git/refs
Karthik Nayak 4ffbb02ee4 refs: extract out `refs_create_refdir_stubs()`
For Git to recognize a directory as a Git directory, it requires the
directory to contain:

  1. 'HEAD' file
  2. 'objects/' directory
  3. 'refs/' directory

Here, #1 and #3 are part of the reference storage mechanism,
specifically the files backend. Since then, newer backends such as the
reftable backend have moved to using their own path ('reftable/') for
storing references. But to ensure Git still recognizes the directory as
a Git directory, we create stubs.

There are two locations where we create stubs:

- In 'refs/reftable-backend.c' when creating the reftable backend.
- In 'clone.c' before spawning transport helpers.

In a following commit, we'll add another instance. So instead of
repeating the code, let's extract out this code to
`refs_create_refdir_stubs()` and use it.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-25 09:27:12 -08:00
..
debug.c Merge branch 'gf/maintenance-is-needed-fix' 2025-12-30 12:58:20 +09:00
files-backend.c refs/files: introduce function to perform normal ref checks 2026-01-12 06:55:41 -08:00
iterator.c refs: drop infrastructure to peel via iterators 2025-11-04 07:32:25 -08:00
packed-backend.c Merge branch 'kn/maintenance-is-needed' 2025-11-21 09:14:17 -08:00
packed-backend.h
ref-cache.c refs: drop infrastructure to peel via iterators 2025-11-04 07:32:25 -08:00
ref-cache.h ref-cache: remove unused function 'find_ref_entry()' 2025-07-15 11:54:19 -07:00
refs-internal.h refs: add a `optimize_required` field to `struct ref_storage_be` 2025-11-10 09:28:48 -08:00
reftable-backend.c refs: extract out `refs_create_refdir_stubs()` 2026-02-25 09:27:12 -08:00