MCPcopy Index your code
hub / github.com/git/git / tmp_objdir_migrate

Function tmp_objdir_migrate

tmp-objdir.c:291–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291int 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
318const char **tmp_objdir_env(const struct tmp_objdir *t)
319{

Callers 2

execute_commandsFunction · 0.85

Calls 7

strbuf_addbufFunction · 0.85
strbuf_addstrFunction · 0.85
migrate_pathsFunction · 0.85
strbuf_releaseFunction · 0.85
tmp_objdir_destroyFunction · 0.85

Tested by

no test coverage detected