aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit
Commit message (Collapse)AuthorAgeFilesLines
* 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>
| * | Prepare 4.9.1-SNAPSHOT buildsMatthias Sohn2017-10-082-19/+19
| | | | | | | | | | | | | | | Change-Id: Ic49fd093d3fe4324c4d83aba74033040fcaa37a6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v4.9.0.201710071750-rv4.9.0.201710071750-rMatthias Sohn2017-10-072-2/+2
| | | | | | | | | | | | | | | Change-Id: I487f6aa3d0c4ef1d57f91cdc36177d994ae24c51 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Add flag for keeping ref tombstones in GC reftableMinh Thai2017-11-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | A tombstone will prevent a delayed reference update from resurrecting the deleted reference. Change-Id: Id9f4df43d435a299ff16cef614821439edef9b11 Signed-off-by: Minh Thai <mthai@google.com>
* | | ObjectDirectory: Add pack directory getterHector Caballero2017-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, in order to get the pack directory it was necessary to resolve it from the object directory. This resolution is already done when creating the object directory, so simplify the call by just adding a getter to the pack directory. Change-Id: I69e783141dc6739024e8b3d5acc30843edd651a7 Signed-off-by: Hector Caballero <hector.caballero@ericsson.com>
* | | Prepare 4.10.0-SNAPSHOT buildsMatthias Sohn2017-10-082-19/+19
|/ / | | | | | | | | Change-Id: I5ca462d1db18a2c5c9382cfb9c83972510fa2b88 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Partially revert c0ad77d8 "Enhance Eclipse save actions"Matthias Sohn2017-08-301-1/+1
| | | | | | | | | | | | | | | | Do not automatically organize imports using a save action since this seems to be buggy and removed some annotations org.eclipse.jgit.pgm needs to use args4j. Change-Id: I5a91292c3b9241ce2dde3e4ecce14ad460097129 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Partially revert c0ad77d8 "Enhance Eclipse save actions"Matthias Sohn2017-08-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert the following save actions which were introduced in c0ad77d8: - always use braces around blocks - remove unused imports Other than I expected save actions are run globally on edited files - and not only on edited code lines only. Hence revert the save action "Convert control statement bodies to blocks" which would affect a large number of code lines not affected by the change editing some small part of a class. This would generate a large number of changes which may lead to many unnecessary conflicts. Total number of affected lines across jgit would be around 10k lines. Also revert "Remove unused imports" since it erroneously removes imports of some annotations needed by pgm classes using args4j. Change-Id: I879a47f68e664129e6124cf25c1ae1f6a2d7a5aa Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Enhance Eclipse save actionsMatthias Sohn2017-08-281-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the following Eclipse save actions executed when saving modified lines. This should help to reduce manual work needed to maintain a clean and consistent code style: - organize imports - always use braces around blocks - add missing annotations - @Override including implementation of interface methods - @Deprecated - remove - unused imports - unnecessary $NON-NLS$ tags - redundant type arguments Also add default values for new settings that were introduced in recent Eclipse versions up to Neon since we updated save rules the last time. Change-Id: Idc90b249df044d0552f04edf01a5f607c4846f50 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add dfs fsck implementationZhen Chen2017-07-261-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | JGit already had some fsck-like classes like ObjectChecker which can check for an individual object. The read-only FsckPackParser which will parse all objects within a pack file and check it with ObjectChecker. It will also check the pack index file against the object information from the pack parser. Change-Id: Ifd8e0d28eb68ff0b8edd2b51b2fa3a50a544c855 Signed-off-by: Zhen Chen <czhen@google.com>
* | Move BatchRefUpdate tests to a new fileDave Borowitz2017-07-251-0/+78
| | | | | | | | | | | | | | | | | | | | Run with @Parameterized, so we don't have to duplicate test setup for each atomic/non-atomic test. We still have to have two different sets of asserts for the cases where the behavior is different. In fact, this is a readability win: it emphasizes that performing the exact same setup except for the atomic setting will have different behavior. Change-Id: I78a8214075e204732a423341f14c09de273a7854
* | Add missing newlines at ends of Java filesDavid Pursehouse2017-07-252-2/+2
| | | | | | | | | | Change-Id: Iead36f53d57ead0eb3edd3f9efb63b6630c9c20c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Merge branch 'stable-4.8'David Pursehouse2017-06-101-0/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.8: SubmoduleUpdateCommand#setCallback should return 'this' CloneCommand#setCallback should return 'this' Prepare 4.7.2-SNAPSHOT builds JGit v4.7.1.201706071930-r ArchiveCommand: Create prefix entry with commit time Run auto GC in the background Update Orbit to the Oxygen version R20170516192513 Change-Id: Ibf90b4899d097474e7836e6baab8829e66fca524 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * Merge branch 'stable-4.7' into stable-4.8Matthias Sohn2017-06-071-0/+7
| |\ | | | | | | | | | | | | | | | | | | * stable-4.7: Run auto GC in the background Change-Id: I5e25765f65d833f13cbe99696ef33055d7f5c4cf Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * Run auto GC in the backgroundDavid Turner2017-06-061-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running an automatic GC on a FileRepository, when the caller passes a NullProgressMonitor, run the GC in a background thread. Use a thread pool of size 1 to limit the number of background threads spawned for background gc in the same application. In the next minor release we can make the thread pool configurable. In some cases, the auto GC limit is lower than the true number of unreachable loose objects, so auto GC will run after every (e.g) fetch operation. This leads to the appearance of poor fetch performance. Since these GCs will never make progress (until either the objects become referenced, or the two week timeout expires), blocking on them simply reduces throughput. In the event that an auto GC would make progress, it's still OK if it runs in the background. The progress will still happen. This matches the behavior of regular git. Git (and now jgit) uses the lock file for gc.log to prevent simultaneous runs of background gc. Further, it writes errors to gc.log, and won't run background gc if that file is present and recent. If gc.log is too old (according to the config gc.logexpiry), it will be ignored. Change-Id: I3870cadb4a0a6763feff252e6eaef99f4aa8d0df Signed-off-by: David Turner <dturner@twosigma.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * Prepare 4.7.1-SNAPSHOTMatthias Sohn2017-04-062-19/+19
| | | | | | | | | | | | | | | Change-Id: I16a45035258276217446bccc0ad1b0991383aa0c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * JGit v4.7.0.201704051617-rv4.7.0.201704051617-rMatthias Sohn2017-04-052-2/+2
| | | | | | | | | | | | | | | Change-Id: Ic2bd6aca0b7a7e0597ffc1f7cf647b49878f9950 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Prepare 4.8.0-SNAPSHOT buildsMatthias Sohn2017-05-172-2/+2
| | | | | | | | | | | | | | | Change-Id: I27fc4e4969fafde0fcba26aeebe30d732770b68f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v4.8.0.201705170830-rc1v4.8.0.201705170830-rc1Matthias Sohn2017-05-172-2/+2
| | | | | | | | | | | | | | | Change-Id: I60c0a40f2e38748641b25a25bcf10346e2950886 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Prepare 4.9.0-SNAPSHOT buildsMatthias Sohn2017-05-302-19/+19
|/ / | | | | | | | | Change-Id: I52a4153d573799e861ab104939f51fac1aceb9ee Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Bazel: Restrict src globs to Java source filesDavid Pursehouse2017-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generating the src list with an unrestricted wildcard causes all files in the source tree to be included. This results in junk files such as .orig (generated during merge conflict resolution) to be included, which causes in a build error: in srcs attribute of java_library rule //org.eclipse.jgit:jgit: file '//org.eclipse.jgit:src/org/eclipse/jgit/gitrepo/RepoCommand.java.orig' is misplaced here (expected .java, .srcjar or .properties). Modify the globs to only include Java source files. Change-Id: Iaef3db33ac71d71047cd28acb0378e15cb09ece9 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Prepare 4.8.0-SNAPSHOT buildsMatthias Sohn2017-04-052-19/+19
|/ | | | | Change-Id: Ifea6750e79d417a8a2a891b3b5f96d68c7200011 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Remove Buck buildDavid Pursehouse2017-03-221-10/+0
| | | | | | Buck will be replaced with Bazel Change-Id: I3cf07d7aaaa2a58bac34e16c50af5416693254ac Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* bazel: Mark junit targets testonlyJonathan Nieder2017-03-191-0/+1
| | | | | | | | | | | Only testonly targets (such as tests) need to use junit. In particular this involves making the toplevel :all rule testonly. It's not clear to me what that rule is for --- "bazel build //..." already works to build all targets. In any case it appears to be for testing, so marking it as testonly shouldn't be harmful. Change-Id: I28ff508ab8ce2ec0a0111109110aa9680d30600e
* bazel: Add explicit targets for library dependenciesJonathan Nieder2017-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | This provides a place to declare visibility restrictions and transitive dependencies for each library. Other targets should only declare dependencies on what they directly use, making dependencies easier to maintain. Trim the dependencies of org.eclipse.jgit:jgit to follow that rule. It declares dependencies on Apache httpcomponents and the servlet API but doesn't use them. Tested: * 'bazel build //...' succeeds * applying the change https://gerrit-review.googlesource.com/90843 to a copy of Gerrit, following the instructions there, and running 'bazel test //...' in that copy of Gerrit still succeeds Change-Id: I3ab958ce8b3227019cdbe4cc81e0f042e1541034
* Enable and fix warnings about redundant specification of type argumentsDavid Pursehouse2017-02-204-7/+7
| | | | | | | | | | Since the introduction of generic type parameter inference in Java 7, it's not necessary to explicitly specify the type of generic parameters. Enable the warning in Eclipse, and fix all occurrences. Change-Id: I9158caf1beca5e4980b6240ac401f3868520aad0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Add API filter for usage of FileRepository in test classesDavid Pursehouse2017-02-201-0/+35
| | | | | | | | | | | FileRepository is in the package org.eclipse.jgit.internal, and is thus non-API. This causes warnings in Eclipse when FileRepository is used. Add a filter to prevent the warnings. Change-Id: I9a8ae106c085bb0e826031fa183b4c4bdabcc5fc Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Enable and fix 'Should be tagged with @Override' warningDavid Pursehouse2017-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Set missingOverrideAnnotation=warning in Eclipse compiler preferences which enables the warning: The method <method> of type <type> should be tagged with @Override since it actually overrides a superclass method Justification for this warning is described in: http://stackoverflow.com/a/94411/381622 Enabling this causes in excess of 1000 warnings across the entire code-base. They are very easy to fix automatically with Eclipse's "Quick Fix" tool. Fix all of them except 2 which cause compilation failure when the project is built with mvn; add TODO comments on those for further investigation. Change-Id: I5772061041fd361fe93137fd8b0ad356e748a29c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* LocalDiskRepositoryTestCase: Add clarifying comment in call to createRepositoryDavid Pursehouse2017-02-101-1/+1
| | | | | | | | | | Clarify that 'true' means 'auto close'. This makes it consistent with other calls that have a boolean argument for 'bare'. It also makes it a bit easier to see what's going on while stepping in the debugger, because it's not necessary to scroll around to find the method declaration. Change-Id: Idacd749407dcfd258af3efaaf44d129069925dd3 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* RepositoryCacheTest: avoid to close already closed repositoryMatthias Sohn2017-01-281-2/+22
| | | | | | | The tearDown() of the superclass closed the repository once more which led to a negative use count warning logged by Repository.close(). Change-Id: I331f85a540c68264a53456276c32f72b79113d61 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* LocalDiskRepositoryTestCase: Only add to toClose through access methodDavid Pursehouse2017-01-281-1/+1
| | | | | | | | | Only using the access method means we only have one place where the toClose set is modified, making it easier to debug either by adding log statements or by setting a breakpoint. Change-Id: I4f9f1774d5f2e10bcab381edfd84bb6ee0499a11 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* LocalDiskRepositoryTestCase: Prevent duplicates in list of repos to closeDavid Pursehouse2017-01-271-1/+3
| | | | | | | | | | Change the "toClose" list to a set, which will not allow duplicate entries. This reduces the number of false positive logs about corrupt use count due to the same repository being closed more than once during teardown. Change-Id: I5ab0ff8b56e7f2b2c7aab5274d957708d26f42c5 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Format Bazel files with buildifierDavid Pursehouse2017-01-221-9/+10
| | | | | Change-Id: I934114315d2c7cab917f1011b8e55c52367d429f Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Implement initial framework of Bazel buildDavid Ostrovsky2017-01-181-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial implementation only builds the packages consumed by Gerrit Code Review. Test build and execution is not implemented. We prefer to consume maven_jar custom rule from bazlets repository, for the same reasons as in the Gerrit project: * Caching artifacts across different clones and projects * Exposing source classifiers and neverlink artifact TEST PLAN: $ bazel build :all $ unzip -t bazel-genfiles/all.zip Archive: bazel-genfiles/all.zip testing: libjgit-archive.jar OK testing: libjgit-servlet.jar OK testing: libjgit.jar OK testing: libjunit.jar OK No errors detected in compressed data of bazel-genfiles/all.zip. Change-Id: Ia837ce95d9829fe2515f37b7a04a71a4598672a0 Signed-off-by: David Ostrovsky <david@ostrovsky.org> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Prepare 4.7.0-SNAPSHOT buildsMatthias Sohn2016-12-272-19/+19
| | | | | Change-Id: I20754d13007e6591d36aae5766f3a9a82b24e120 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.6.1-SNAPSHOT buildsMatthias Sohn2016-12-242-19/+19
| | | | | Change-Id: I6b05a6f6c3f92365c272e1bdaf76093ca01f2d58 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.6.0.201612231935-rv4.6.0.201612231935-rMatthias Sohn2016-12-242-2/+2
| | | | | Change-Id: Iaa88fe1b195dfe6be99a7b4cb064684e75563715 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Define MonotonicClock interface for advanced timestampsShawn Pearce2016-11-214-6/+118
| | | | | | | | | | | | | MonotonicClock can be implemented to provide more certainity about time than the standard System.currentTimeMillis() can provide. This can be used by classes such as PersonIdent and Ketch to rely on more certainity about time moving in a strictly ascending order. Gerrit Code Review can also leverage this interface through its embedding of JGit and use MonotonicClock and ProposedTimestamp to provide stronger assurance that NoteDb time is moving forward. Change-Id: I1a3cbd49a39b150a0d49b36d572da113ca83a786
* Deprecate SafeBufferedOutputStreamShawn Pearce2016-11-141-3/+3
| | | | | | | | | | | | | | | | | | | | | Java 8 fixed the silent flush during close issue by FilterOutputStream (base class of BufferedOutputStream) using try-with-resources to close the stream, getting a behavior matching what JGit's SafeBufferedOutputStream was doing: try { flush(); } finally { out.close(); } With Java 8 as the minimum required version to run JGit it is no longer necessary to override close() or have this class. Deprecate the class, and use the JRE's version of close. Change-Id: Ic0584c140010278dbe4062df2e71be5df9a797b3
* Organize importsDavid Pursehouse2016-11-141-2/+11
| | | | | Change-Id: I7c545d06b1bced678c020fab9af1382bc4416b6e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Change JGit minimum execution environment to JavaSE-1.8Matthias Sohn2016-09-203-5/+5
| | | | | Bug: 500059 Change-Id: I47f3f6749a67da52029f84e002d9b155ed56d2b7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.6.0-SNAPSHOT buildsMatthias Sohn2016-09-192-17/+17
| | | | | Change-Id: Id2eafc331ee32c332c2a9b867b05c260beb0d10f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>