| 254 | } |
| 255 | |
| 256 | void odb_restore_primary_source(struct object_database *odb, |
| 257 | struct odb_source *restore_source, |
| 258 | const char *old_path) |
| 259 | { |
| 260 | struct odb_source *cur_source = odb->sources; |
| 261 | |
| 262 | if (strcmp(old_path, cur_source->path)) |
| 263 | BUG("expected %s as primary object store; found %s", |
| 264 | old_path, cur_source->path); |
| 265 | |
| 266 | if (cur_source->next != restore_source) |
| 267 | BUG("we expect the old primary object store to be the first alternate"); |
| 268 | |
| 269 | odb->repo->disable_ref_updates = false; |
| 270 | odb->sources = restore_source; |
| 271 | odb_source_free(cur_source); |
| 272 | } |
| 273 | |
| 274 | char *compute_alternate_path(const char *path, struct strbuf *err) |
| 275 | { |
no test coverage detected