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

Function refs_create_refdir_stubs

refs.c:2194–2215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2192}
2193
2194void refs_create_refdir_stubs(struct repository *repo, const char *refdir,
2195 const char *refs_heads_content)
2196{
2197 struct strbuf path = STRBUF_INIT;
2198
2199 strbuf_addf(&path, "%s/HEAD", refdir);
2200 write_file(path.buf, "ref: refs/heads/.invalid");
2201 adjust_shared_perm(repo, path.buf);
2202
2203 strbuf_reset(&path);
2204 strbuf_addf(&path, "%s/refs", refdir);
2205 safe_create_dir(repo, path.buf, 1);
2206
2207 if (refs_heads_content) {
2208 strbuf_reset(&path);
2209 strbuf_addf(&path, "%s/refs/heads", refdir);
2210 write_file(path.buf, "%s", refs_heads_content);
2211 adjust_shared_perm(repo, path.buf);
2212 }
2213
2214 strbuf_release(&path);
2215}
2216
2217/* backend functions */
2218int ref_store_create_on_disk(struct ref_store *refs, int flags, struct strbuf *err)

Callers 3

ref_store_create_on_diskFunction · 0.85
setup_alternate_ref_dirFunction · 0.85
cmd_cloneFunction · 0.85

Calls 5

strbuf_addfFunction · 0.85
write_fileFunction · 0.85
adjust_shared_permFunction · 0.85
safe_create_dirFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected