backend functions */
| 2216 | |
| 2217 | /* backend functions */ |
| 2218 | int 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 | |
| 2238 | int ref_store_remove_on_disk(struct ref_store *refs, struct strbuf *err) |
| 2239 | { |
no test coverage detected