diff options
Diffstat (limited to 'src/com/gitblit/utils/JGitUtils.java')
-rw-r--r-- | src/com/gitblit/utils/JGitUtils.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java index 72a8ab3c..ab5b655b 100644 --- a/src/com/gitblit/utils/JGitUtils.java +++ b/src/com/gitblit/utils/JGitUtils.java @@ -309,9 +309,14 @@ public class JGitUtils { if (onlyBare && gitDir.getName().equals(".git")) {
continue;
}
- // determine repository name relative to base path
- String repository = FileUtils.getRelativePath(baseFile, file);
- list.add(repository);
+ if (gitDir.equals(file) || gitDir.getParentFile().equals(file)) {
+ // determine repository name relative to base path
+ String repository = FileUtils.getRelativePath(baseFile, file);
+ list.add(repository);
+ } else if (searchSubfolders && file.canRead()) {
+ // look for repositories in subfolders
+ list.addAll(getRepositoryList(basePath, file, onlyBare, searchSubfolders));
+ }
} else if (searchSubfolders && file.canRead()) {
// look for repositories in subfolders
list.addAll(getRepositoryList(basePath, file, onlyBare, searchSubfolders));
|