MCPcopy Create free account
hub / github.com/git/git / ref_store_create_on_disk

Function ref_store_create_on_disk

refs.c:2218–2236  ·  view source on GitHub ↗

backend functions */

Source from the content-addressed store, hash-verified

2216
2217/* backend functions */
2218int ref_store_create_on_disk(struct ref_store *refs, int flags, struct strbuf *err)
2219{
2220 int ret = refs->be->create_on_disk(refs, flags, err);
2221
2222 if (!ret) {
2223 /* Creation of stubs for linked worktrees are handled in the worktree code. */
2224 if (!(flags & REF_STORE_CREATE_ON_DISK_IS_WORKTREE) && refs->repo->ref_storage_payload) {
2225 refs_create_refdir_stubs(refs->repo, refs->repo->gitdir,
2226 "repository uses alternate refs storage");
2227 } else if (ref_storage_format_by_name(refs->be->name) != REF_STORAGE_FORMAT_FILES) {
2228 struct strbuf msg = STRBUF_INIT;
2229 strbuf_addf(&msg, "this repository uses the %s format", refs->be->name);
2230 refs_create_refdir_stubs(refs->repo, refs->gitdir, msg.buf);
2231 strbuf_release(&msg);
2232 }
2233 }
2234
2235 return ret;
2236}
2237
2238int ref_store_remove_on_disk(struct ref_store *refs, struct strbuf *err)
2239{

Callers 3

add_worktreeFunction · 0.85

Calls 4

refs_create_refdir_stubsFunction · 0.85
strbuf_addfFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected