]> source.dussan.org Git - jgit.git/commitdiff
Recognize symlinks in the FileTreeIterator 94/15394/17
authorRobin Rosenberg <robin.rosenberg@dewire.com>
Wed, 10 Jul 2013 22:18:33 +0000 (00:18 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Wed, 12 Feb 2014 10:09:24 +0000 (11:09 +0100)
We did this for the Eclipse Platform in the ContainerTreeIterator.

Change-Id: I80d8157cc0dd99d57e2ed5d7cd8b13525a0c62b1

org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java

index 9e89791b849b2fd094fe3fc8fc577b772b0da333..8dc8276b3fb44be7f8934d2e05563e9188206489 100644 (file)
@@ -166,7 +166,9 @@ public class FileTreeIterator extends WorkingTreeIterator {
                public FileEntry(final File f, FS fs) {
                        this.fs = fs;
                        attributes = fs.getAttributes(f);
-                       if (attributes.isDirectory()) {
+                       if (attributes.isSymbolicLink())
+                               mode = FileMode.SYMLINK;
+                       else if (attributes.isDirectory()) {
                                if (new File(f, Constants.DOT_GIT).exists())
                                        mode = FileMode.GITLINK;
                                else