| 2192 | } |
| 2193 | |
| 2194 | void 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 */ |
| 2218 | int ref_store_create_on_disk(struct ref_store *refs, int flags, struct strbuf *err) |
no test coverage detected