diff options
Diffstat (limited to 'tmp-objdir.c')
-rw-r--r-- | tmp-objdir.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tmp-objdir.c b/tmp-objdir.c index c38fbeb5e8..056484404b 100644 --- a/tmp-objdir.c +++ b/tmp-objdir.c @@ -17,7 +17,7 @@ struct tmp_objdir { struct repository *repo; struct strbuf path; struct strvec env; - struct object_directory *prev_odb; + struct odb_source *prev_source; int will_destroy; }; @@ -46,8 +46,8 @@ int tmp_objdir_destroy(struct tmp_objdir *t) if (t == the_tmp_objdir) the_tmp_objdir = NULL; - if (t->prev_odb) - restore_primary_odb(t->prev_odb, t->path.buf); + if (t->prev_source) + restore_primary_odb(t->prev_source, t->path.buf); err = remove_dir_recursively(&t->path, 0); @@ -276,11 +276,11 @@ int tmp_objdir_migrate(struct tmp_objdir *t) if (!t) return 0; - if (t->prev_odb) { - if (t->repo->objects->odb->will_destroy) + if (t->prev_source) { + if (t->repo->objects->sources->will_destroy) BUG("migrating an ODB that was marked for destruction"); - restore_primary_odb(t->prev_odb, t->path.buf); - t->prev_odb = NULL; + restore_primary_odb(t->prev_source, t->path.buf); + t->prev_source = NULL; } strbuf_addbuf(&src, &t->path); @@ -309,19 +309,19 @@ void tmp_objdir_add_as_alternate(const struct tmp_objdir *t) void tmp_objdir_replace_primary_odb(struct tmp_objdir *t, int will_destroy) { - if (t->prev_odb) + if (t->prev_source) BUG("the primary object database is already replaced"); - t->prev_odb = set_temporary_primary_odb(t->path.buf, will_destroy); + t->prev_source = set_temporary_primary_odb(t->path.buf, will_destroy); t->will_destroy = will_destroy; } struct tmp_objdir *tmp_objdir_unapply_primary_odb(void) { - if (!the_tmp_objdir || !the_tmp_objdir->prev_odb) + if (!the_tmp_objdir || !the_tmp_objdir->prev_source) return NULL; - restore_primary_odb(the_tmp_objdir->prev_odb, the_tmp_objdir->path.buf); - the_tmp_objdir->prev_odb = NULL; + restore_primary_odb(the_tmp_objdir->prev_source, the_tmp_objdir->path.buf); + the_tmp_objdir->prev_source = NULL; return the_tmp_objdir; } |