aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java
Commit message (Collapse)AuthorAgeFilesLines
* [errorprone] Fix UnnecessaryParentheses errorsMatthias Sohn2024-04-281-3/+2
| | | | | | See https://errorprone.info/bugpattern/UnnecessaryParentheses Change-Id: I783fd24286ec1bd55efbf21d05758465f4af87ee
* Update EDL 1.0 license headers to new short SPDX compliant formatMatthias Sohn2020-01-041-38/+5
| | | | | | | | | | This is the format given by the Eclipse legal doc generator [1]. [1] https://www.eclipse.org/projects/tools/documentation.php?id=technology.jgit Bug: 548298 Change-Id: I8d8cabc998ba1b083e3f0906a8d558d391ffb6c4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Ensure LocalDiskRepositoryTestCase#setup fully uses MockSystemReaderMatthias Sohn2019-08-111-16/+29
| | | | | | | | | | | | | | | | | FS#getFileStoreAttributes used the real userConfig and not the mocked one. This led to test errors when running tests with Bazel since it sandboxes tests which prevents they can write to ~/.gitconfig. Fix this by first preparing the MockedSystemReader and the mocked config before calling FS#getFileStoreAttributes. Also fix ConfigTest which broke due to this change since it inherits from LocalDiskRepositoryTestCase and calls its setup method which was changed here. We can no longer assert by comparing plain text since FS adds FileStoreAttributes to the mocked userConfig. Also the default options seen by this test changed since we now use a mocked config. Change-Id: I76bc7c94953fe979266147d3b309a68dda9d4dfe Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Run auto GC in the backgroundDavid Turner2017-06-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Enable and fix warnings about redundant specification of type argumentsDavid Pursehouse2017-02-201-1/+1
| | | | | | | | | | 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>
* ConfigTest: Create Git instance in try-with-resourceDavid Pursehouse2016-01-211-1/+3
| | | | | Change-Id: Ie65c69e0f1aed95bcdf68ebd68d21b3e2590b41c Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
* Fix failing ConfigTest on WindowsRobin Rosenberg2014-05-171-23/+7
| | | | | | Trust the detection of features and just test CoreConfig. Change-Id: I37f838d270a221a75d0d3842ba2f3f90aa1d6f01
* Add symlink support to JGitRobin Rosenberg2014-02-101-0/+22
| | | | | | | | | | | | | | | | | | | | The change includes comparing symbolic links between disk and index, adding symbolic links to the index, creating/modifying links on checkout. The behavior is controlled by the core.symlinks setting, just as C Git does. When a new repository is created core.symlinks will be set depending on the capabilities of the operating system and Java runtime. If core.symlinks is set to true, the assumption is that symlinks are supported, which may result in runtime errors if this turns out not to be the case. Measuring the cost of jgit status on a repository with ~70000 files, of which ~30000 are tracked reveals a penalty of about 10% for using the Java7 (really NIO2) support module. Bug: 354367 Change-Id: I12f0fdd9d26212324a586896ef7eb1f6ff89c39c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Set core.precomposeunicode to true when creating repository on MacRobin Rosenberg2012-08-221-5/+14
| | | | | | | | | Java has no option but to use precomposed Unicode, so we should state that when creating a new repository. Not that Java will use precomposed unicode regardless of this setting, but this reduces the risk of incompatibility with C Git. Change-Id: I3779b75f76d2e2061c836cbc9b4b7c2ae0cf18f4
* In org.eclipse.jgit.pgm.ConfigTest expect core.filemode=false on WindowsTomasz Zarna2012-06-161-8/+10
| | | | Change-Id: I8f8ae7a8bc0793643184bc0e7afa9f4e2c5ff1a1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Do not set core.autocrlf when creating repoRobin Rosenberg2012-06-121-7/+8
| | | | | | | | | | | | core.autorlf defaults to false, but can be set in the user or "system" config files. Note that EGit/JGit may not know where the "system" config file is located. Also fix pgm's ConfigTest which depends on default repository configuration. Bug: 382067 Change-Id: I2c698a76e30d968e7f351b4f5a2195f0b124f62f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add config --list command to pgmTomasz Zarna2012-05-231-0/+70
Currently, only --list option is supported with --global, --system, --local and --file switches. Change-Id: I9b179b162996520e95c4e001dccd65c566a4bd27 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>