aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit
Commit message (Collapse)AuthorAgeFilesLines
* Make inner classes static where possibleDavid Pursehouse2019-06-171-1/+1
| | | | | | | | | | | | | | As reported by Error Prone: An inner class should be static unless it references members of its enclosing class. An inner class that is made non-static unnecessarily uses more memory and does not make the intent of the class clear. See https://errorprone.info/bugpattern/ClassCanBeStatic Change-Id: Ib99d120532630dba63cf400cc1c61c318286fc41 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com> (cherry picked from commit ee40efcea44bc0c9a28afe29a80c87636947484e)
* Prepare 5.1.9-SNAPSHOT buildsMatthias Sohn2019-06-052-19/+19
| | | | | Change-Id: I60571e4e0bea04bb2c25ef3d0332a9ab6895db06 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v5.1.8.201906050907-rv5.1.8.201906050907-rMatthias Sohn2019-06-052-2/+2
| | | | | Change-Id: Iae0ffe161df2ca8a800d21688d6b7d7419dfb640 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Enhance fsTick() to use filesystem timer resolutionChristian Halstrick2019-06-051-8/+16
| | | | | | | | | | RepositoryTestCase.fsTick() was was waiting 64, 128, 256, ... milliseconds until it detected that the filesystem timer has ticked. Make use of the filesystemtimer resolution information in FS to sleep a fraction of the filesystem timer resolution. That raises probability to wake up shortly after the filesystem timer has ticked. Change-Id: Ibcc38576e42ece13b2fd4423a29c459eed167a69
* Measure file timestamp resolution used in FileSnapshotMatthias Sohn2019-05-221-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | FileSnapshot.notRacyClean() assumed a worst case filesystem timestamp resolution of 2.5 sec (FAT has a resolution of 2 sec). Instead measure timestamp resolution to avoid unnecessary IO caused by false positives in detecting the racy git problem caused by finite filesystem timestamp resolution [1]. Cache the measured resolution per FileStore since timestamp resolution depends on the respective filesystem type. If timestamp resolution cannot be measured or fails due to an exception fallback to the worst case FAT timestamp resolution and avoid caching this value. Add a 10% safety margin in FileSnapshot.notRacyClean(), though running FsTest.testFsTimestampResolution() 1000 times which is not using a safety margin didn't fail on Mac using APFS and Java 8, 11, 12. Measured Java file timestamp resolution: [2] [1] https://github.com/git/git/blob/master/Documentation/technical/racy-git.txt [2] https://docs.google.com/spreadsheets/d/1imy0y6WmRqBf0kjCxzxj2X7M50eIVfa7oaUIzEOHmjo Bug: 546891 Change-Id: I493f3b57b6b306285ffa7d392339d253e5966ab8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 5.1.8-SNAPSHOT buildsMatthias Sohn2019-04-202-19/+19
| | | | | Change-Id: I331bbaefd42ef94673ae8565c9b2b3af9eadfda0 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v5.1.7.201904200442-rv5.1.7.201904200442-rMatthias Sohn2019-04-202-2/+2
| | | | | Change-Id: Ifaa3a88c5e117912a8c691b8b8369dd9a17faebb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 5.1.7-SNAPSHOT buildsMatthias Sohn2019-03-132-19/+19
| | | | | Change-Id: Ica716b2ad18f8390e75466430ef81c86ea06f004 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v5.1.6.201903130242-rv5.1.6.201903130242-rMatthias Sohn2019-03-132-2/+2
| | | | | Change-Id: Iaf5e451f72dc8512afee99a9f3fb91aa348e3cf5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 5.1.6-SNAPSHOT buildsMatthias Sohn2018-12-272-19/+19
| | | | | Change-Id: If3313d602aa57cfa031ba2c9ec03bd51b464dc19 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v5.1.5.201812261915-rv5.1.5.201812261915-rMatthias Sohn2018-12-272-2/+2
| | | | | Change-Id: I249a440d1ca1c997343da942ae55fcb27a645b92 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 5.1.5-SNAPSHOT buildsMatthias Sohn2018-12-262-19/+19
| | | | | Change-Id: I3eeb24b01a4f955e7e933238defb42635ebfec7d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v5.1.4.201812251853-rv5.1.4.201812251853-rMatthias Sohn2018-12-262-2/+2
| | | | | Change-Id: I30ba167bcd8144074553d7446a45fa6be19584fe Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 5.1.4-SNAPSHOT buildsMatthias Sohn2018-10-202-19/+19
| | | | | Change-Id: Iee86860f3b4eb9f4af818c60342fd29465c0474c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v5.1.3.201810200350-rv5.1.3.201810200350-rMatthias Sohn2018-10-202-2/+2
| | | | | Change-Id: Ib2c5a79d4fdf77680b7b65652fc3659527df27ad Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 5.1.3-SNAPSHOT buildsMatthias Sohn2018-10-062-19/+19
| | | | | Change-Id: I75c1a01885115fc709ab37f181234264c3f7423a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v5.1.2.201810061102-rv5.1.2.201810061102-rMatthias Sohn2018-10-062-2/+2
| | | | | Change-Id: Id34e4ae12a796460862edc37c5eb072314199bf4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 5.1.2-SNAPSHOT buildsMatthias Sohn2018-09-182-19/+19
| | | | | Change-Id: I095d246e27de747a234bc058725454c222be51ce Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v5.1.1.201809181055-rv5.1.1.201809181055-rMatthias Sohn2018-09-182-2/+2
| | | | | Change-Id: I2366444fca125139eadb6d513be721167a266d70 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 5.1.1-SNAPSHOT buildsMatthias Sohn2018-09-112-19/+19
| | | | | Change-Id: Ie220dd95fae18f894e2a04a5ae6d29a1e5a6d76b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v5.1.0.201809111528-rv5.1.0.201809111528-rMatthias Sohn2018-09-112-2/+2
| | | | | Change-Id: I583bf7d60bccc876156be1f605bfda32b89cd08b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 5.1.0-SNAPSHOT buildsMatthias Sohn2018-09-052-2/+2
| | | | | Change-Id: I3d06c5237edae54b09f465f415f5a308b5e7ceff Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v5.1.0.201809051400-rc1v5.1.0.201809051400-rc1Matthias Sohn2018-09-052-2/+2
| | | | | Change-Id: I0b53f95ee51d94da8b029c9bb10eb854ff9dd4f6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Deprecate Constants.CHARSET in favor of StandardCharsets.UTF_8David Pursehouse2018-09-044-9/+9
| | | | | Change-Id: I3b748620f067582afef20f144feebe40d0332be2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Return parsed objects from TestRepository.commit/tree/blob()Terry Parker2018-06-281-12/+13
| | | | | | | | | | | | | It is convenient for TestRepository to return fully parsed objects from its commit()/tree()/blob() methods, so that test code doesn't have to remember to parse them before making assertions about them. Update TestRepostiory to return fully parsed objects. Adjust the tests that are affected by this change in behavior. Change-Id: I09d03d0c80ad22cb7092f4a2eaed99d40a10af63 Signed-off-by: Terry Parker <tparker@google.com>
* Prepare 5.1.0-SNAPSHOT buildsMatthias Sohn2018-05-232-19/+19
| | | | | Change-Id: I8523a993ae1f7b62573d7547273bc1356bf64fa7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix trivial usages of deprecated Repository#getAllRefsDavid Pursehouse2018-05-231-3/+3
| | | | | | | | | | | | Callers of getAllRefs that only iterate over the `values()` of the returned map can be trivially fixed to call getRefDatabase().getRefs() instead. Only fix those where the calling method is already declared to throw IOException, to avoid potential API changes. Change-Id: I2b05f785077a1713953cfd42df7bf915f889f90b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Remove further unnecessary 'final' keywordsHan-Wen Nienhuys2018-05-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove it from * package private functions. * try blocks * for loops this was done with the following python script: $ cat f.py import sys import re import os def replaceFinal(m): return m.group(1) + "(" + m.group(2).replace('final ', '') + ")" methodDecl = re.compile(r"^([\t ]*[a-zA-Z_ ]+)\(([^)]*)\)") def subst(fn): input = open(fn) os.rename(fn, fn + "~") dest = open(fn, 'w') for l in input: l = methodDecl.sub(replaceFinal, l) dest.write(l) dest.close() for root, dirs, files in os.walk(".", topdown=False): for f in files: if not f.endswith('.java'): continue full = os.path.join(root, f) print full subst(full) Change-Id: If533a75a417594fc893e7c669d2c1f0f6caeb7ca Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
* Remove 'final' in parameter listsHan-Wen Nienhuys2018-05-156-36/+36
| | | | | Change-Id: Id924f79c8b2c720297ebc49bf9c5d4ddd6d52547 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
* Add API filter for "non-API type FileRepository" in testsDavid Pursehouse2018-05-061-0/+35
| | | | | Change-Id: If805ad4a962e48dd16fbc7eff915fd6539839933 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Open auto-closeable resources in try-with-resourceDavid Pursehouse2018-03-131-19/+14
| | | | | | | | | | | | | | | | | | | | When an auto-closeable resources is not opened in try-with-resource, the warning "should be managed by try-with-resource" is emitted by Eclipse. Fix the ones that can be silenced simply by moving the declaration of the variable into a try-with-resource. In cases where we explicitly call the close() method, for example in tests where we are testing specific behavior caused by the close(), suppress the warning. Leave the ones that will require more significant refcactoring to fix. They can be done in separate commits that can be reviewed and tested in isolation. Change-Id: I9682cd20fb15167d3c7f9027cecdc82bc50b83c4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Consistently use Constants.CHARSET rather than StandardCharsets.UTF_8David Pursehouse2018-03-114-9/+9
| | | | | Change-Id: I6714fc3666e1bced22abba94ceb700477349586e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Prepare 5.0.0-SNAPSHOT buildsMatthias Sohn2018-03-082-19/+19
| | | | | Change-Id: I2d2f50ed8a12f310e7cac68eed5536bd460c403f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.11.1-SNAPSHOT buildsMatthias Sohn2018-03-082-19/+19
| | | | | Change-Id: Id9aa6b7e8f56de5183b6cd57ef0e790ec9debd4d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.11.0.201803080745-rv4.11.0.201803080745-rMatthias Sohn2018-03-082-2/+2
| | | | | Change-Id: Ie24a33bc8a24c30db06fe7b175f405efb95776ec Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGitTestUtil: Open auto-closeable resources in try-with-resourceDavid Pursehouse2018-03-071-16/+7
| | | | | Change-Id: Ibc8dd8509109708628e5189888fa528add486452 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Use StandardCharsets.UTF_8 in testsDavid Pursehouse2018-03-073-4/+8
| | | | | | | Replace hard-coded "UTF-8" string with the constant. Change-Id: Ie812add2df28e984090563ec7c6e2c0366616424 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Enable warning for resources not managed by try-with-resourceDavid Pursehouse2018-03-031-1/+1
| | | | | Change-Id: Iefe97de6bdb62af558f1b0e77c9205a9186f9b4c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Honor CRLF settings when writing merge resultsThomas Wolf2018-02-021-8/+8
| | | | | | | | | | | Merges are performed using the raw text as stored in the git repository. When we write the merge result, we must apply the correct CRLF settings. Otherwise the line endings in the result will be wrong. Bug: 499615 Change-Id: I37a9b987e9404c97645d2720cd1c7c04c076a96b Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.11.0-SNAPSHOT buildsMatthias Sohn2017-12-312-19/+19
| | | | | Change-Id: I5d5e2befcf530d93457d44684bd9e4fc2392e5eb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add header Automatic-Module-Name for Java 9Karsten Thoms2017-12-231-0/+1
| | | | | | Bug: 529075 Change-Id: I4532ce2c80eb91531d46026676502d636ccda706 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Repeat: Fix javadoc to say 'annotation' instead of 'interface'David Pursehouse2017-12-181-1/+1
| | | | | Change-Id: Ib0c4ec28d6b7e2fc0fe71f7dc53dd12ccd6e8a2f Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Fix javadoc in org.eclipse.jgit.junitMatthias Sohn2017-12-1711-22/+323
| | | | | Change-Id: I1107e6a82849ac329361baabb5c481d86ea6dc9e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Specify consistent version range for junit in OSGi manifestsDavid Pursehouse2017-12-081-4/+4
| | | | | | | | | | There are several different version ranges specified in the various manifest files. Align them all to the same range: [4.12,5.0.0) Change-Id: I02205b8b8546c9f53ed431b5fd9abf6ddcda4423 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Use constants from StandardCharsets instead of hard-coded stringsDavid Pursehouse2017-12-071-1/+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>
* Merge branch 'stable-4.9'Matthias Sohn2017-11-242-36/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Ignore warning for minor version change without API change Silence boxing warning Prepare 4.5.5-SNAPSHOT builds JGit v4.5.4.201711221230-r Fix LockFile semantics when running on NFS Honor trustFolderStats also when reading packed-refs Prepare 4.5.4-SNAPSHOT builds JGit v4.5.3.201708160445-r Change-Id: Icc33d2e36f140e8714fce088379673a8834ae9de
| * Ignore warning for minor version change without API changeMatthias Sohn2017-11-241-1/+11
| | | | | | | | | | | | | | | | - this is a new warning option in Eclipse 4.7 and higher - we always change version of all bundles in a release to keep release engineering simple Change-Id: Ic7523d77b67b2802f1bab3bc70af250d712a034f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Merge branch 'stable-4.8' into stable-4.9Matthias Sohn2017-11-241-35/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.8: Silence boxing warning Prepare 4.5.5-SNAPSHOT builds JGit v4.5.4.201711221230-r Fix LockFile semantics when running on NFS Honor trustFolderStats also when reading packed-refs Prepare 4.5.4-SNAPSHOT builds JGit v4.5.3.201708160445-r Change-Id: I7cf2e48934195430b3945b6d74b092f93a3ccd36 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * Prepare 4.8.1-SNAPSHOT buildsMatthias Sohn2017-06-122-19/+19
| | | | | | | | | | | | | | | Change-Id: I7ca4186bbfe5ccc3fed4509a1fe4fc47bb2e8c50 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * JGit v4.8.0.201706111038-rv4.8.0.201706111038-rMatthias Sohn2017-06-112-2/+2
| | | | | | | | | | | | | | | Change-Id: Ie33623a2191ffffc2ca5756fd078a7003c0c660f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>