* Since packed-refs is only stored in the common dir, don't parse the * payload and rely on the files-backend to set 'gitdir' correctly. */
| 216 | * payload and rely on the files-backend to set 'gitdir' correctly. |
| 217 | */ |
| 218 | struct ref_store *packed_ref_store_init(struct repository *repo, |
| 219 | const char *payload UNUSED, |
| 220 | const char *gitdir, |
| 221 | const struct ref_store_init_options *opts) |
| 222 | { |
| 223 | struct packed_ref_store *refs = xcalloc(1, sizeof(*refs)); |
| 224 | struct ref_store *ref_store = (struct ref_store *)refs; |
| 225 | struct strbuf sb = STRBUF_INIT; |
| 226 | |
| 227 | base_ref_store_init(ref_store, repo, gitdir, &refs_be_packed); |
| 228 | refs->store_flags = opts->access_flags; |
| 229 | |
| 230 | strbuf_addf(&sb, "%s/packed-refs", gitdir); |
| 231 | refs->path = strbuf_detach(&sb, NULL); |
| 232 | chdir_notify_reparent("packed-refs", &refs->path); |
| 233 | return ref_store; |
| 234 | } |
| 235 | |
| 236 | /* |
| 237 | * Downcast `ref_store` to `packed_ref_store`. Die if `ref_store` is |
no test coverage detected