use of com.google.gerrit.server.git.DelegateRepository in project gerrit by GerritCodeReview.
the class ConvertRefStorage method run.
@Override
public void run() throws Exception {
enableGracefulStop();
Project.NameKey projectName = projectState.getNameKey();
try (Repository repo = repoManager.openRepository(projectName)) {
if (repo instanceof DelegateRepository) {
((DelegateRepository) repo).convertRefStorage(storageFormat.name(), writeLogs, backup);
} else {
checkState(repo instanceof FileRepository, "Repository is not an instance of FileRepository!");
((FileRepository) repo).convertRefStorage(storageFormat.name(), writeLogs, backup);
}
} catch (RepositoryNotFoundException e) {
throw die("'" + projectName + "': not a git archive", e);
} catch (IOException e) {
throw die("Error converting: '" + projectName + "': " + e.getMessage(), e);
}
}
Aggregations