mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-28 23:55:54 +00:00
f1666375bd
I want to keep the index updated within the transaction. I tried doing that by adding a `trait Index`, implemented by `ReadonlyIndex` and `MutableIndex`. However, `ReadonlyRepo::index` is of type `Mutex<Option<Arc<IndexFile>>>` (because it is lazily initialized), and we cannot get a `&dyn Index` that lives long enough to be returned from a `Repo::index()` from that. It seems the best solution is to instead create an `Index` enum (instead of a trait), with one readonly and one mutable variant. This commit starts the migration to that design by replacing the `Repo` trait by an enum. I never intended for there there to be more implementations of `Repo` than `ReadonlyRepo` and `MutableRepo` anyway. |
||
---|---|---|
.. | ||
protos | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml |