Initialize the GitRepositoryManager configuration section.
| 26 | |
| 27 | /** Initialize the GitRepositoryManager configuration section. */ |
| 28 | @Singleton |
| 29 | class InitGitManager implements InitStep { |
| 30 | private final ConsoleUI ui; |
| 31 | private final Section gerrit; |
| 32 | |
| 33 | @Inject |
| 34 | InitGitManager(ConsoleUI ui, Section.Factory sections) { |
| 35 | this.ui = ui; |
| 36 | this.gerrit = sections.get("gerrit", null); |
| 37 | } |
| 38 | |
| 39 | @Override |
| 40 | public void run() { |
| 41 | ui.header("Git Repositories"); |
| 42 | |
| 43 | Path d = gerrit.path("Location of Git repositories", "basePath", "git"); |
| 44 | if (d == null) { |
| 45 | throw die("gerrit.basePath is required"); |
| 46 | } |
| 47 | FileUtil.mkdirsOrDie(d, "Cannot create"); |
| 48 | } |
| 49 | } |
nothing calls this directly
no outgoing calls
no test coverage detected