Allow to get the path of repositories not created yet Change-Id: I59b97ddd58f6c887f6f345038b5b71d7163097f8
diff --git a/src/main/java/com/googlesource/gerrit/plugins/adminconsole/GetFullPathCommand.java b/src/main/java/com/googlesource/gerrit/plugins/adminconsole/GetFullPathCommand.java index 4052f42..8a64dc9 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/adminconsole/GetFullPathCommand.java +++ b/src/main/java/com/googlesource/gerrit/plugins/adminconsole/GetFullPathCommand.java
@@ -40,14 +40,12 @@ private String projectName = ""; private LocalDiskRepositoryManager localDiskRepositoryManager; - private ProjectCache projectCache; @Inject GetFullPathCommand(GitRepositoryManager grm, ProjectCache pc) { if (grm instanceof LocalDiskRepositoryManager) { localDiskRepositoryManager = (LocalDiskRepositoryManager) grm; } - projectCache = pc; } @Override @@ -56,13 +54,9 @@ throw new UnloggedFailure(1, "Command only works with disk based repository managers"); } Project.NameKey nameKey = new Project.NameKey(projectName); - if (projectCache.get(nameKey) != null) { - stdout.println( - localDiskRepositoryManager - .getBasePath(nameKey) - .resolve(nameKey.get().concat(Constants.DOT_GIT_EXT))); - } else { - throw new UnloggedFailure(1, "Repository not found"); - } + stdout.println( + localDiskRepositoryManager + .getBasePath(nameKey) + .resolve(nameKey.get().concat(Constants.DOT_GIT_EXT))); } }
diff --git a/src/main/resources/Documentation/cmd-get-path.md b/src/main/resources/Documentation/cmd-get-path.md index 6383150..fc913c2 100644 --- a/src/main/resources/Documentation/cmd-get-path.md +++ b/src/main/resources/Documentation/cmd-get-path.md
@@ -13,7 +13,8 @@ DESCRIPTION ----------- -Get the full path of an existing repository. +Get the full path of a repository. If the repository does not exist, the path +returned is the one where the repository would be if it gets created. ARGUMENTS ---------