diff options
author | James Moger <james.moger@gitblit.com> | 2012-08-10 17:37:36 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-08-10 17:37:36 -0400 |
commit | 88fb67f6cfdef7a3d44691aca623d3486fec3655 (patch) | |
tree | ff6b573fe7ba067e00c17f9945744c320744af19 | |
parent | 086c0447227a4075b66b976088542fee113b0d4f (diff) | |
download | gitblit-88fb67f6cfdef7a3d44691aca623d3486fec3655.tar.gz gitblit-88fb67f6cfdef7a3d44691aca623d3486fec3655.zip |
Improve submodule checking in LuceneExecutor (issue-119)
-rw-r--r-- | src/com/gitblit/LuceneExecutor.java | 3 | ||||
-rw-r--r-- | src/com/gitblit/models/PathModel.java | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/com/gitblit/LuceneExecutor.java b/src/com/gitblit/LuceneExecutor.java index d1c27f4d..9cae3d52 100644 --- a/src/com/gitblit/LuceneExecutor.java +++ b/src/com/gitblit/LuceneExecutor.java @@ -652,6 +652,9 @@ public class LuceneExecutor implements Runnable { Resolution.MINUTE);
IndexWriter writer = getIndexWriter(repositoryName);
for (PathChangeModel path : changedPaths) {
+ if (path.isSubmodule()) {
+ continue;
+ }
// delete the indexed blob
deleteBlob(repositoryName, branch, path.name);
diff --git a/src/com/gitblit/models/PathModel.java b/src/com/gitblit/models/PathModel.java index c78b300c..9bb7eb73 100644 --- a/src/com/gitblit/models/PathModel.java +++ b/src/com/gitblit/models/PathModel.java @@ -46,6 +46,10 @@ public class PathModel implements Serializable, Comparable<PathModel> { this.commitId = commitId;
}
+ public boolean isSubmodule() {
+ return FileMode.GITLINK.equals(mode);
+ }
+
public boolean isTree() {
return FileMode.TREE.equals(mode);
}
@@ -71,6 +75,13 @@ public class PathModel implements Serializable, Comparable<PathModel> { if (isTree && otherTree) {
return path.compareTo(o.path);
} else if (!isTree && !otherTree) {
+ if (isSubmodule() && o.isSubmodule()) {
+ return path.compareTo(o.path);
+ } else if (isSubmodule()) {
+ return -1;
+ } else if (o.isSubmodule()) {
+ return 1;
+ }
return path.compareTo(o.path);
} else if (isTree && !otherTree) {
return -1;
|