The Unified and Autonomous Development Platform
fix issue #175 - Path filter in revision diff does not work as expected sometimes
Robin Shen61e25563827d
diff --git a/server-core/src/main/java/io/onedev/server/web/component/diff/revision/RevisionDiffPanel.java b/server-core/src/main/java/io/onedev/server/web/component/diff/revision/RevisionDiffPanel.javaindex 61ff0f096d..845ba21c6c 100644--- a/server-core/src/main/java/io/onedev/server/web/component/diff/revision/RevisionDiffPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/diff/revision/RevisionDiffPanel.java@@ -214,16 +214,13 @@ public class RevisionDiffPanel extends Panel {Matcher matcher = new PathMatcher();for (BlobChange change: changes) {String oldPath = change.getOldBlobIdent().path;- if (oldPath == null)- oldPath = "";- else+ if (oldPath != null)oldPath = oldPath.toLowerCase();String newPath = change.getNewBlobIdent().path;- if (newPath == null)- newPath = "";- else+ if (newPath != null)newPath = newPath.toLowerCase();- if (patternSet.matches(matcher, oldPath) || patternSet.matches(matcher, newPath)) {+ if (oldPath != null && patternSet.matches(matcher, oldPath)+ || newPath != null && patternSet.matches(matcher, newPath)) {filteredChanges.add(change);}}