DESCRIPTION

Make the ContainerTreeIterator recognize symbolic links

We cannot rely on Eclipse's resource handling here since it
looks at the link target rather than the link itself.

Change-Id: I94bfd493805478f2a232229ce6d25a0d810bfd0f


COMMENTS

author: Brenden Conley
date: 2014-02-23 19:04:00.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/egit/job/egit-stable.gerrit/304/

-------------------------------------
author: Brenden Conley
date: 2014-02-23 19:18:00.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit-stable.gerrit/304/ : temporary update site https://hudson.eclipse.org/egit/job/egit-stable.gerrit/${BUILD_NUMBER}/artifact/org.eclipse.egit.repository/target/repository/

-------------------------------------
author: Douglas Trujillo
date: 2014-02-23 21:59:29.000000000

Patch Set 2:

ok this helps to properly show a symlinked directory :-)

though if I am changing the link to point to another directory (now link name and directory name don't match anymore) I hit a NPE, not sure if this is related to this change

java.lang.NullPointerException
	at org.eclipse.jgit.treewalk.WorkingTreeIterator.readContentAsNormalizedString(WorkingTreeIterator.java:976)
	at org.eclipse.jgit.treewalk.WorkingTreeIterator.contentCheck(WorkingTreeIterator.java:925)
	at org.eclipse.jgit.treewalk.WorkingTreeIterator.isModified(WorkingTreeIterator.java:848)
	at org.eclipse.jgit.treewalk.filter.IndexDiffFilter.include(IndexDiffFilter.java:223)
	at org.eclipse.jgit.treewalk.filter.AndTreeFilter$List.include(AndTreeFilter.java:163)
	at org.eclipse.jgit.treewalk.TreeWalk.next(TreeWalk.java:560)
	at org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:389)
	at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.calcIndexDiffDataFull(IndexDiffCacheEntry.java:486)
	at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.access$7(IndexDiffCacheEntry.java:475)
	at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry$4.run(IndexDiffCacheEntry.java:286)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

example:
- clone egit
- cd to org.eclipse.egit.core/src/org/eclipse/egit/core
- ln -s ../../../../../../org.eclipse.egit.ui.test org.eclipse.egit.ui
- refresh package explorer -> above NPE is thrown
- instead I would expect the symlink to be marked dirty
- when directory name of symlink source and target are identical no NPE is thrown

-------------------------------------
author: Juliet Cantu
date: 2014-02-26 08:16:27.000000000

Patch Set 2:

I can't reproduce here. We could protect the use of repository by checking if it is null, like we do in some other places, but I'd like to know exactly why.

-------------------------------------
author: Douglas Trujillo
date: 2014-02-26 14:01:39.000000000

Patch Set 2:

I missed to mention that I first committed the symlink with another target folder:
* clone egit
* cd to org.eclipse.egit.core/src/org/eclipse/egit/core
* ln -s ../../../../../../org.eclipse.egit.ui org.eclipse.egit.ui
* add and commit the new symlink from EGit
* now change the link to point to another target
 rm org.eclipse.egit.ui
 ln -s ../../../../../../org.eclipse.egit.ui.test org.eclipse.egit.ui
* refresh package explorer -> above NPE is thrown
* instead I would expect the symlink to be marked dirty
* when directory name of symlink source and target are identical no NPE is thrown

-------------------------------------
author: Juliet Cantu
date: 2014-02-28 06:24:07.000000000

Patch Set 2:

Fix pushed for stable-3.3 in JGit

-------------------------------------
