Skip to contentSkip to conversation

Won't append '/' to an empty repo relative path.

PATCH In review Jing Xue 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore

Jing Xue

author
#0 lore raw

PATCH 1/1 Won't append '/' to an empty repo relative path.

When the repo relative path is empty, the extra "/" causes all subsequent "startsWith" tests to fail.

---
 .../egit/ui/internal/actions/CommitAction.java     |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java +5 -1
index 82cad58..7d638c7 100644
@@ -358,7 +358,11 @@ public class CommitAction implements IObjectActionDelegate {
 	}
 
 	private void includeList(IProject project, HashSet<String> added, ArrayList<IFile> category) {
-		String repoRelativePath = RepositoryMapping.getMapping(project).getRepoRelativePath(project) + "/";
+		String repoRelativePath = RepositoryMapping.getMapping(project).getRepoRelativePath(project);
+		if (repoRelativePath.length() > 0) { 
+			repoRelativePath += "/";
+		}
+
 		for (String filename : added) {
 			try {
 				if (!filename.startsWith(repoRelativePath))
Signature · 1 line
1.5.3.2.116.ge36bb5
#1 lore raw

fredag 28 september 2007 skrev Jing Xue:

Quoted 4 lines

When the repo relative path is empty, the extra "/" causes all subsequent "startsWith" tests to fail.

Thank you.

Please cc me in the future.

--- robin