diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2015-12-21 19:43:56 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2016-10-11 00:20:23 +0200 |
commit | 26832a00e4f6cfbc3b0319e08665755d54ce3689 (patch) | |
tree | d1dbb663eb4eee3f580af13b5fbb960324960a44 /org.eclipse.jgit.test/tst-rsrc | |
parent | 295e5a4f1e2a5c3e5a69226afad7da901c21883f (diff) | |
download | jgit-26832a00e4f6cfbc3b0319e08665755d54ce3689.tar.gz jgit-26832a00e4f6cfbc3b0319e08665755d54ce3689.zip |
Fix symlink content comparison on MacOS in tree walk
Symlinks on MacOS are written as UTF-8 NFD, but
readSymbolicLink().toString() converts to NFC with potentially fewer
bytes. May occur in particular if the link target has non-ASCII
characters for which the NFC and NFD encodings differ. This may lead
to an EOFException: Short read of block.
This causes all kinds of weird effects in EGit, ranging from failing
rebases (which report the exception to the user) to EGit decorations in
the navigator silently disappearing (and never coming back).
* Rename readContentAsNormalizedString() to readSymlinkTarget() as it's
called only for symlinks. Also make it protected.
* Fix by allowing the read to succeed even if less than the expected
number of bytes are returned by the entry's input stream.
* Override in FileTreeIterator to use fs.readSymlink() directly.
Includes a new MacOS-only test.
Change-Id: I264c5972d67b1cbb1ed690580f5706e671b9affd
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst-rsrc')
-rw-r--r-- | org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/indexdiff/filerepo.txt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/indexdiff/filerepo.txt b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/indexdiff/filerepo.txt new file mode 100644 index 0000000000..3255efb8c6 --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/indexdiff/filerepo.txt @@ -0,0 +1,30 @@ +blob +mark :1 +data 10 +äéü.txt +blob +mark :2 +data 8 +test.txt +blob +mark :3 +data 5 +Test + +blob +mark :4 +data 7 +äéü + +reset refs/heads/master +commit refs/heads/master +mark :5 +author A U Thor <author@example.com> 1450727513 +0100 +committer A U Thor <author@example.com> 1450727513 +0100 +data 26 +Initial commit with links +M 120000 :1 testfolder/aeu.txt +M 120000 :2 testfolder/link.txt +M 100644 :3 testfolder/test.txt +M 100644 :4 testfolder/äéü.txt + |