Closed jfontan closed 5 years ago
One question (not doubting, just want to understand better): what's the rationale for this change?
One question (not doubting, just want to understand better): what's the rationale for this change?
@juanjux You are right, there was almost no description to the PR :see_no_evil:. I've updated the description with the problem it's fixing.
@jfontan awesome description, thanks!
I've just rebased with latest master
.
Also fix a bug getting the cache size from cli.
Before integrating the use of
go-borges
repositories were managed byRepositoryPool
. When it was created it initialized a git object cache that is used by all the repositories. This cache is also used when using indexes and reading directly from packfiles (cache is retrieved withRepository.Cache()
, https://github.com/src-d/gitbase/blob/master/packfiles.go#L239).Now
go-borges
takes care of repository libraries and retrieving go-git repositories from them. To make it work the same we initializego-borges
library with a cache generated ingitbase
(command.Server
) but I forgot thatRepositoryPool
was also generating a cache internally and returning it when callingRepository.Cache()
. This means that there was two different objects caches, one for repositories opened without indexes and other for reading packfiles when the index was used. The problems are:The change makes
RepositoryPool
get an initialized cache that will be used by all repos (both with and without index).make upgrade
command if applicable.