diff --git a/core/src/main/java/hudson/scm/SubversionEventHandlerImpl.java b/core/src/main/java/hudson/scm/SubversionEventHandlerImpl.java index bef0b65c353f3a655d2566885cb689a180d0543d..307f853b0f7c24f5f7ea40187625cd6f36f294d2 100644 --- a/core/src/main/java/hudson/scm/SubversionEventHandlerImpl.java +++ b/core/src/main/java/hudson/scm/SubversionEventHandlerImpl.java @@ -169,14 +169,19 @@ public class SubversionEventHandlerImpl extends SVNEventAdapter { String inPath = file.getCanonicalPath().replace(File.separatorChar, '/'); String basePath = baseDir.getCanonicalPath().replace(File.separatorChar, '/'); String commonRoot = getCommonAncestor(inPath, basePath); + + String relativePath = inPath; if (commonRoot != null) { if (equals(inPath , commonRoot)) { return ""; } else if (startsWith(inPath, commonRoot + "/")) { - return inPath.substring(commonRoot.length() + 1); + relativePath = inPath.substring(commonRoot.length() + 1); } } - return inPath; + if (relativePath.endsWith("/")) { + relativePath = relativePath.substring(0, relativePath.length() - 1); + } + return relativePath; } private static String getCommonAncestor(String p1, String p2) {