[EGIT PATCH] Support linked resources

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a project that outputs to a linked directory (for example the
project is in /projects/foo and the project outputs to /projects/bar).
This was causing egit to throw a bunch of "file is not in working
path" errors whenever I rebuilt the project or otherwise interacted
with that linked directory. I tracked it down to GitIndex's add/remove
being called on these files even though these files are not part of
the actual index.

It seems like egit shouldn't be trying to interact with the index on
these files, and after looking at it, I decided the best solution
would be to realize in the RepositoryMapping that these files do not
point to a repository.

I wasn't sure what the best solution for deciding if a file was in the
same location as the project it is referenced in, but I somewhat
modeled it off of the way GitIndex's makeKey does its validation.

Patch:
Fixed 'Path is not in working directory' error for linked resources

Signed-off-by: Reg Vos <jerry.vos@xxxxxxxxx>
---
 .../egit/core/project/RepositoryMapping.java       |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java
b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java
index 6a0b56f..5863a49 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java
@@ -236,6 +236,8 @@ public class RepositoryMapping {
 		IProject project = resource.getProject();
 		if (project == null)
 			return null;
+		if (!project.getLocation().isPrefixOf(resource.getLocation()))
+			return null;
 		RepositoryProvider provider = RepositoryProvider.getProvider(project);
 		if (!(provider instanceof GitProvider))
 			return null;
-- 
1.5.4.2
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux