Some updates may involve modifying the database, reindexing, and doing
post-update operations but never actually touch the git repository.
Lazily open the repository only when necessary. Since we now no longer
need to throw from the constructor, we can use normal assisted
injection.
Also allow overriding the repository in case the caller already has
one available, as for example in MergeOp. In this case, the close
method of the BatchUpdate should be a no-op, assuming the caller takes
care of that.
Change-Id: I65f49e004a324f7a9b22bed9b1e06295866e4f99