Inject config into local repository
The git.localRepository abstraction has operations that require access to the configuration. Currently, the configuration is accessed via a global variable. Instead, this should be dependency injected to support #2699 (closed).
Originally reported in !2713 (comment 445896337)