| 289 | } |
| 290 | |
| 291 | int tmp_objdir_migrate(struct tmp_objdir *t) |
| 292 | { |
| 293 | struct strbuf src = STRBUF_INIT, dst = STRBUF_INIT; |
| 294 | int ret; |
| 295 | |
| 296 | if (!t) |
| 297 | return 0; |
| 298 | |
| 299 | if (t->prev_source) { |
| 300 | if (t->repo->objects->sources->will_destroy) |
| 301 | BUG("migrating an ODB that was marked for destruction"); |
| 302 | odb_restore_primary_source(t->repo->objects, t->prev_source, t->path.buf); |
| 303 | t->prev_source = NULL; |
| 304 | } |
| 305 | |
| 306 | strbuf_addbuf(&src, &t->path); |
| 307 | strbuf_addstr(&dst, repo_get_object_directory(t->repo)); |
| 308 | |
| 309 | ret = migrate_paths(t, &src, &dst, 0); |
| 310 | |
| 311 | strbuf_release(&src); |
| 312 | strbuf_release(&dst); |
| 313 | |
| 314 | tmp_objdir_destroy(t); |
| 315 | return ret; |
| 316 | } |
| 317 | |
| 318 | const char **tmp_objdir_env(const struct tmp_objdir *t) |
| 319 | { |
no test coverage detected