threads / patch / 10056

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

Subject: [EGIT PATCH] Won't append '/' to an empty repo relative path.

## tl;dr

2 messages between Sep 28, 2007 and Sep 28, 2007. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Jing Xue· Sep 28, 2007, 04:39 UTC · lore

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

Signed-off-by: Jing Xue <jingxue@digizenstudio.com>
---
 .../egit/ui/internal/actions/CommitAction.java     |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
Show changes to org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java +5 −1
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java
index 82cad58..7d638c7 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java
@@ -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))
-- 
1.5.3.2.116.ge36bb5
Robin Rosenberg· Sep 28, 2007, 19:15 UTC · re: Jing Xue · lore

Re: [EGIT PATCH] Won't append '/' to an empty repo relative path.

fredag 28 september 2007 skrev Jing Xue:
> 
> 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

← back to recent threads