Community
Participate
Working Groups
See original review comment in Gerrit [1]. Unfortunately if target of a link is not normalized path, new File(target) will normalize it, so that physical link will differ on file system from the original one. E.g. "/tmp/" target will be created as "/tmp" etc. This is limitation of Java 7 implementation, native git does everything right. As a result, working directory of the repository containing not normalized link targets will be *always* dirty after checkout. It would be nice if we could report here some kind of warning: if(!nioTarget.toString().equals(target)){ Sys.err.println("Failed to create expected link (target is not normalized). Link: '" + path + "', original target: '" + target + "', created target: '" + nioTarget + "'.") } Additionally it would be nice to have some extra javadoc for the method in FileUtil and in FS class. [1] https://git.eclipse.org/r/#/c/9378/25/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FileUtil.java
I think we should check for the normalized case and report link as matching if that is the case
Is there any other normalization beside stripping extra slashes?
(In reply to comment #2) > Is there any other normalization beside stripping extra slashes? Not that we've seen this. BTW it strips all "extra" slashes, not just trailing: ..//com/make/Makefile will be changed to ../com/make/Makefile
It seems new File(string) does this, so I think we'll use that to normalize whatever we read from disk.
(In reply to comment #4) > It seems new File(string) does this It *does* it and so all File/Path based API's.
Maybe https://git.eclipse.org/r/#/c/15393/ fixes this