aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/indexdiff
Commit message (Collapse)AuthorAgeFilesLines
* IndexDiffWithSymlinkTest: handle InaccessibleObjectExceptionMatthias Sohn2021-09-291-1/+3
| | | | | | | On Java 16 this test throws InaccessibleObjectException, handle and ignore it similar to IllegalAccessException. Change-Id: I19b4f577579694a146516861a7ec567141f3464b
* Deprecate Constants.CHARSET in favor of StandardCharsets.UTF_8David Pursehouse2018-09-041-3/+3
| | | | | Change-Id: I3b748620f067582afef20f144feebe40d0332be2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Specify charset when constructing InputStreamReaderDavid Pursehouse2018-09-021-1/+1
| | | | | | | | | | | | ErrorProne warns [1] about implicit use of the platform default charset, which can result in differing behaviour between JVM executions or incorrect behavior if the encoding of the data source doesn't match expectations. [1] http://errorprone.info/bugpattern/DefaultCharset Change-Id: I0fd489d352170339c3867355cd24324dfdbd4b59 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Consistently use Constants.CHARSET rather than StandardCharsets.UTF_8David Pursehouse2018-03-111-2/+2
| | | | | Change-Id: I6714fc3666e1bced22abba94ceb700477349586e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* IndexDiffWithSymlinkTest: Open InputStream in try-with-resourceDavid Pursehouse2018-03-071-6/+4
| | | | | Change-Id: I5f49f80debb2259f665748408cd3604f869fa3ef Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Use constants from StandardCharsets instead of hard-coded stringsDavid Pursehouse2017-12-071-3/+2
| | | | | | | | | | | | | | | | Instead of hard-coding the charset strings "US-ASCII", "UTF-8", and "ISO-8859-1", use the corresponding constants from StandardCharsets. UnsupportedEncodingException is not thrown when the StandardCharset constants are used, so remove the now redundant handling. Because the encoding names are no longer hard-coded strings, also remove redundant $NON-NLS warning suppressions. Also replace existing usages of the constants with static imports. Change-Id: I0a4510d3d992db5e277f009a41434276f95bda4e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Fix some tests for running in bazelThomas Wolf2017-08-311-1/+5
| | | | | | | | | | | | | | | | | Some tests call out to external cgit. Those tests all failed for me locally on Mac. Turned out that the reason was that the system git config used by the git in the bazel run contained paths with ~/ but somehow $HOME was not set. As a result the external git returned with exit code 128. Fix this by passing along $HOME explicitly. Also improve assertions to make sure we do get the stderr of the external command in the test log. I hadn't noticed that until now because apparently the maven build does pass along $HOME. Change-Id: I7069676d5cc7b23a71e79a4866fe8acab5a405f4 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Fix symlink content comparison on MacOS in tree walkThomas Wolf2016-10-111-0/+234
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>