]> source.dussan.org Git - gitblit.git/commitdiff
Properly handle renames on incremental indexing
authorJames Moger <james.moger@gitblit.com>
Tue, 20 Mar 2012 23:39:20 +0000 (19:39 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 20 Mar 2012 23:39:20 +0000 (19:39 -0400)
src/com/gitblit/LuceneExecutor.java
src/com/gitblit/utils/JGitUtils.java

index 29a8569d526b522b22f5beed649ea3f531962267..a425cc3d1099e40cad6dfd0b6f3f7b0b477c3649 100644 (file)
@@ -622,7 +622,7 @@ public class LuceneExecutor implements Runnable {
                        IndexWriter writer = getIndexWriter(repositoryName);\r
                        for (PathChangeModel path : changedPaths) {\r
                                // delete the indexed blob\r
-                               deleteBlob(repositoryName, branch, path.path);\r
+                               deleteBlob(repositoryName, branch, path.name);\r
 \r
                                // re-index the blob\r
                                if (!ChangeType.DELETE.equals(path.changeType)) {\r
index c39ab715da5f115369583996f91b33352322a7dc..99b2f73828e336cb241b203cd64009bb7a80442a 100644 (file)
@@ -721,6 +721,10 @@ public class JGitUtils {
                                                list.add(new PathChangeModel(diff.getOldPath(), diff.getOldPath(), 0, diff\r
                                                                .getNewMode().getBits(), commit.getId().getName(), diff\r
                                                                .getChangeType()));\r
+                                       } else if (diff.getChangeType().equals(ChangeType.RENAME)) {\r
+                                               list.add(new PathChangeModel(diff.getOldPath(), diff.getNewPath(), 0, diff\r
+                                                               .getNewMode().getBits(), commit.getId().getName(), diff\r
+                                                               .getChangeType()));\r
                                        } else {\r
                                                list.add(new PathChangeModel(diff.getNewPath(), diff.getNewPath(), 0, diff\r
                                                                .getNewMode().getBits(), commit.getId().getName(), diff\r