diff options
-rw-r--r-- | src/main/java/com/gitblit/utils/JGitUtils.java | 4 | ||||
-rw-r--r-- | src/test/java/com/gitblit/tests/JGitUtilsTest.java | 7 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/main/java/com/gitblit/utils/JGitUtils.java b/src/main/java/com/gitblit/utils/JGitUtils.java index ecc63592..be2860de 100644 --- a/src/main/java/com/gitblit/utils/JGitUtils.java +++ b/src/main/java/com/gitblit/utils/JGitUtils.java @@ -1049,10 +1049,10 @@ public class JGitUtils { List<TreeFilter> suffixFilters = new ArrayList<TreeFilter>();
for (String extension : extensions) {
if (extension.charAt(0) == '.') {
- suffixFilters.add(PathSuffixFilter.create("\\" + extension));
+ suffixFilters.add(PathSuffixFilter.create(extension));
} else {
// escape the . since this is a regexp filter
- suffixFilters.add(PathSuffixFilter.create("\\." + extension));
+ suffixFilters.add(PathSuffixFilter.create("." + extension));
}
}
TreeFilter filter;
diff --git a/src/test/java/com/gitblit/tests/JGitUtilsTest.java b/src/test/java/com/gitblit/tests/JGitUtilsTest.java index 9f7cb31e..a9374958 100644 --- a/src/test/java/com/gitblit/tests/JGitUtilsTest.java +++ b/src/test/java/com/gitblit/tests/JGitUtilsTest.java @@ -48,8 +48,6 @@ import org.eclipse.jgit.util.FileUtils; import org.junit.Test;
import com.gitblit.Constants.SearchType;
-import com.gitblit.GitBlit;
-import com.gitblit.Keys;
import com.gitblit.models.GitNote;
import com.gitblit.models.PathModel;
import com.gitblit.models.PathModel.PathChangeModel;
@@ -484,14 +482,11 @@ public class JGitUtilsTest { @Test
public void testDocuments() throws Exception {
Repository repository = GitBlitSuite.getTicgitRepository();
- List<String> extensions = GitBlit.getStrings(Keys.web.markdownExtensions);
+ List<String> extensions = Arrays.asList(new String[] { ".mkd", ".md" });
List<PathModel> markdownDocs = JGitUtils.getDocuments(repository, extensions);
- List<PathModel> markdownDocs2 = JGitUtils.getDocuments(repository,
- Arrays.asList(new String[] { ".mkd", ".md" }));
List<PathModel> allFiles = JGitUtils.getDocuments(repository, null);
repository.close();
assertTrue(markdownDocs.size() > 0);
- assertTrue(markdownDocs2.size() > 0);
assertTrue(allFiles.size() > markdownDocs.size());
}
|