From: Robin Rosenberg <robin.rosenberg@dewire.com>
To: git@vger.kernel.org
Cc: spearce@spearce.org
Subject: [PATCH] Fix compare at project level, non-root project
Date: Mon, 19 Mar 2007 01:19:09 +0100 [thread overview]
Message-ID: <20070319001909.29489.55145.stgit@lathund.dewire.com> (raw)
Compare didn't work at the project level when the project wasn't
the same as the git working directory, i.e. egit itself.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../core/internal/mapping/GitFileRevision.java | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileRevision.java b/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileRevision.java
index 7b726f7..def142f 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileRevision.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileRevision.java
@@ -150,9 +150,14 @@ public class GitFileRevision extends FileRevision {
tree = repositoryMapping.getRepository().mapTree(getCommit().getTreeId());
String prefix = repositoryMapping.getSubset();
if (prefix != null) {
- prefix = prefix + "/";
- String name = prefix + resource.getProjectRelativePath().toString();
- return tree.findMember(name);
+ String relPath = resource.getProjectRelativePath().toString();
+ if (relPath.equals(""))
+ return tree;
+ else {
+ prefix = prefix + "/";
+ String name = prefix + relPath;
+ return tree.findMember(name);
+ }
} else
return tree;
} catch (IOException e) {
reply other threads:[~2007-03-19 0:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20070319001909.29489.55145.stgit@lathund.dewire.com \
--to=robin.rosenberg@dewire.com \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.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).