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

2 messages from 2007-09-28 to 2007-09-28. Participants: Jing Xue, Robin Rosenberg.
Thread: https://gitlist.dev/t/10056

## Jing Xue, 2007-09-28 04:39

Subject: [EGIT PATCH] Won't append '/' to an empty repo relative path.
Message-ID: <20070928043957.GA18592@falcon.digizenstudio.com>
URL: https://gitlist.dev/e/20070928043957.GA18592%40falcon.digizenstudio.com

```

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(-)

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, 2007-09-28 19:15

Subject: Re: [EGIT PATCH] Won't append '/' to an empty repo relative path.
Message-ID: <200709282115.22310.robin.rosenberg.lists@dewire.com>
URL: https://gitlist.dev/e/200709282115.22310.robin.rosenberg.lists%40dewire.com
In-Reply-To: <20070928043957.GA18592@falcon.digizenstudio.com>

```
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

```
