Don't expose RepoView#getRepository()

For the purposes of fusing BatchUpdateOp#updateChange and updateRepo
into a single batch update, implementations of updateChange need to be
able to observe the ref updates from updateRepo before they are
executed. If we expose the repository directly to updateRepo, it's too
easy for them use it in a wrong way that won't see the results of
updateRepo. That is why we limited the operations that are available
through RepoView.

Finish this refactoring by not exposing the Repository to any op phases,
including updateRepo.

The repo still needs to be directly accessed by the BatchUpdate
internals so it can actually do the writes, which is fine as it doesn't
escape this package.

Change-Id: I0959aa2d2bce346a9a6d493c23a38301b43d1e5d
This commit is contained in:
Dave Borowitz
2017-03-22 18:20:18 -07:00
parent ca35762592
commit bc3385e842
21 changed files with 384 additions and 136 deletions

View File

@@ -246,6 +246,7 @@ junit_tests(
"//lib:guava",
"//lib:guava-retrying",
"//lib:protobuf",
"//lib:truth-java8-extension",
"//lib/bouncycastle:bcprov",
"//lib/bouncycastle:bcpkix",
"//lib/dropwizard:dropwizard-core",