Browse Source
We've found in Gerrit Code Review that it is common to pass around both an ObjectReader (or more commonly a RevWalk wrapping one) and an ObjectInserter. These code paths often assume that the ObjectReader can read back any objects created by the ObjectInserter without flushing. However, we previously had no way to enforce that constraint programmatically, leading to hard-to-spot problems. Provide a solution by exposing the ObjectInserter that created an ObjectReader, when known. Callers can either continue passing both objects and check: reader.getCreatedFromInserter() == inserter or they can just pass around ObjectReader and extract the inserter when it's needed (checking that it's not null at usage time). Change-Id: Ibbf5d1968b506f6b47030ab1b046ffccb47352eastable-4.4
Dave Borowitz
9 years ago
6 changed files with 62 additions and 2 deletions
Loading…
Reference in new issue