// Copyright (C) 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.gerrit.server.git;

import com.google.gerrit.lifecycle.LifecycleModule;
import com.google.gerrit.server.config.RepositoryConfig;
import com.google.inject.Inject;

/**
 * Module to install {@link MultiBaseLocalDiskRepositoryManager} rather than {@link
 * LocalDiskRepositoryManager} if needed.
 */
public class GitRepositoryManagerModule extends LifecycleModule {

  private final RepositoryConfig repoConfig;

  @Inject
  public GitRepositoryManagerModule(RepositoryConfig repoConfig) {
    this.repoConfig = repoConfig;
  }

  @Override
  protected void configure() {
    if (repoConfig.getAllBasePaths().isEmpty()) {
      install(new LocalDiskRepositoryManager.Module());
    } else {
      install(new MultiBaseLocalDiskRepositoryManager.Module());
    }
  }
}

@@ -693,16 +693,60 @@
 Module;%0A
+import com.google.gerrit.server.ModuleImpl;%0A
 import c
@@ -794,16 +794,16 @@
 Config;%0A
-
 import c
@@ -962,16 +962,78 @@
 ed.%0A */%0A
+@ModuleImpl(name = GitRepositoryManagerModule.MANAGER_MODULE)%0A
 public c
@@ -1089,16 +1089,77 @@
 Module %7B
+%0A  public static final String MANAGER_MODULE = %22git-manager%22;
 %0A%0A  priv

Add possibility to override MultiBaseLocalDiskRepositoryManager