summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-07-10 23:54:07 -0400
committerJames Moger <james.moger@gitblit.com>2012-07-10 23:54:07 -0400
commit23600183b80713d7c87300316de0b06596d673e3 (patch)
tree1e82a4ebd1f4cd5c9329f9b37070fd59cfa10023 /src
parent3fb41fdec5712b792da05e8549c2c0a31f112ca0 (diff)
downloadgitblit-23600183b80713d7c87300316de0b06596d673e3.tar.gz
gitblit-23600183b80713d7c87300316de0b06596d673e3.zip
Adjust repository search to handle foo.git and foo/bar.git (issue 104)
Diffstat (limited to 'src')
-rw-r--r--src/com/gitblit/utils/JGitUtils.java11
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));