]> source.dussan.org Git - gitblit.git/commitdiff
Fix Markdown document enumeraton
authorJames Moger <james.moger@gitblit.com>
Wed, 16 Oct 2013 17:14:30 +0000 (13:14 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 16 Oct 2013 17:14:30 +0000 (13:14 -0400)
src/main/java/com/gitblit/utils/JGitUtils.java
src/test/java/com/gitblit/tests/JGitUtilsTest.java

index ecc6359298063cb3d73a5ff56cba0200db7420c5..be2860de9f764ceaddcb11b1e8eef4ac2574fdbf 100644 (file)
@@ -1049,10 +1049,10 @@ public class JGitUtils {
                                List<TreeFilter> suffixFilters = new ArrayList<TreeFilter>();\r
                                for (String extension : extensions) {\r
                                        if (extension.charAt(0) == '.') {\r
-                                               suffixFilters.add(PathSuffixFilter.create("\\" + extension));\r
+                                               suffixFilters.add(PathSuffixFilter.create(extension));\r
                                        } else {\r
                                                // escape the . since this is a regexp filter\r
-                                               suffixFilters.add(PathSuffixFilter.create("\\." + extension));\r
+                                               suffixFilters.add(PathSuffixFilter.create("." + extension));\r
                                        }\r
                                }\r
                                TreeFilter filter;\r
index 9f7cb31ea2defd5c0bf9c6f2420d745e4c6e18a4..a93749584f30663d73d7d7b2226e82a38f43f28f 100644 (file)
@@ -48,8 +48,6 @@ import org.eclipse.jgit.util.FileUtils;
 import org.junit.Test;\r
 \r
 import com.gitblit.Constants.SearchType;\r
-import com.gitblit.GitBlit;\r
-import com.gitblit.Keys;\r
 import com.gitblit.models.GitNote;\r
 import com.gitblit.models.PathModel;\r
 import com.gitblit.models.PathModel.PathChangeModel;\r
@@ -484,14 +482,11 @@ public class JGitUtilsTest {
        @Test\r
        public void testDocuments() throws Exception {\r
                Repository repository = GitBlitSuite.getTicgitRepository();\r
-               List<String> extensions = GitBlit.getStrings(Keys.web.markdownExtensions);\r
+               List<String> extensions = Arrays.asList(new String[] { ".mkd", ".md" });\r
                List<PathModel> markdownDocs = JGitUtils.getDocuments(repository, extensions);\r
-               List<PathModel> markdownDocs2 = JGitUtils.getDocuments(repository,\r
-                               Arrays.asList(new String[] { ".mkd", ".md" }));\r
                List<PathModel> allFiles = JGitUtils.getDocuments(repository, null);\r
                repository.close();\r
                assertTrue(markdownDocs.size() > 0);\r
-               assertTrue(markdownDocs2.size() > 0);\r
                assertTrue(allFiles.size() > markdownDocs.size());\r
        }\r
 \r