aboutsummaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-03-04 10:52:58 -0800
committerJunio C Hamano <gitster@pobox.com>2026-03-04 10:52:59 -0800
commit1d0a2acb78f157d39937a088548e561b27722e8d (patch)
tree4251f1f0f2a4ce4a6ee6f71e75d17d0bdbe4f948 /refs.h
parent50d063e335afd5828fbb9de2f2b2fb44fd884d2b (diff)
parent53592d68e86814fcc4a8df6cc38340597e56fe5a (diff)
downloadgit-1d0a2acb78f157d39937a088548e561b27722e8d.tar.xz
Merge branch 'kn/ref-location'
Allow the directory in which reference backends store their data to be specified. * kn/ref-location: refs: add GIT_REFERENCE_BACKEND to specify reference backend refs: allow reference location in refstorage config refs: receive and use the reference storage payload refs: move out stub modification to generic layer refs: extract out `refs_create_refdir_stubs()` setup: don't modify repo in `create_reference_database()`
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index f16b1b697b..f3a1d604ad 100644
--- a/refs.h
+++ b/refs.h
@@ -1428,4 +1428,17 @@ void ref_iterator_free(struct ref_iterator *ref_iterator);
int do_for_each_ref_iterator(struct ref_iterator *iter,
each_ref_fn fn, void *cb_data);
+/*
+ * Git only recognizes a directory as a repository if it contains:
+ * - HEAD file
+ * - refs/ folder
+ * While it is necessary within the files backend, newer backends may not
+ * follow the same structure. To go around this, we create stubs as necessary.
+ *
+ * If provided with a 'refs_heads_content', we create the 'refs/heads/head' file
+ * with the provided message.
+ */
+void refs_create_refdir_stubs(struct repository *repo, const char *refdir,
+ const char *refs_heads_content);
+
#endif /* REFS_H */