git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jing Xue <jingxue@digizenstudio.com>
To: git <git@vger.kernel.org>
Subject: [EGIT PATCH] Won't append '/' to an empty repo relative path.
Date: Fri, 28 Sep 2007 00:39:57 -0400	[thread overview]
Message-ID: <20070928043957.GA18592@falcon.digizenstudio.com> (raw)


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

             reply	other threads:[~2007-09-28  4:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-28  4:39 Jing Xue [this message]
2007-09-28 19:15 ` [EGIT PATCH] Won't append '/' to an empty repo relative path Robin Rosenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070928043957.GA18592@falcon.digizenstudio.com \
    --to=jingxue@digizenstudio.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).