* [PATCH] Fix compare at project level, non-root project
@ 2007-03-19 0:19 Robin Rosenberg
0 siblings, 0 replies; only message in thread
From: Robin Rosenberg @ 2007-03-19 0:19 UTC (permalink / raw
To: git; +Cc: spearce
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) {
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-03-19 0:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-19 0:19 [PATCH] Fix compare at project level, non-root project Robin Rosenberg
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).