aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'stable-5.13' into stable-6.0Matthias Sohn2021-12-311-2/+38
|\ | | | | | | | | | | | | * stable-5.13: Use FileSnapshot without using configs for FileBasedConfig Change-Id: Iaff40b144aea9ad5e6d0fa6b448ad7d527992832
| * Merge branch 'stable-5.12' into stable-5.13Matthias Sohn2021-12-311-2/+38
| |\ | | | | | | | | | | | | | | | | | | * stable-5.12: Use FileSnapshot without using configs for FileBasedConfig Change-Id: I6a0266cbcaaf18d0d60f0abecb5434fd919c44b7
| | * Merge branch 'stable-5.11' into stable-5.12Matthias Sohn2021-12-311-2/+38
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.11: Use FileSnapshot without using configs for FileBasedConfig Change-Id: I4e241860c2ca50750e22c2761c515c9895688c55
| | | * Merge branch 'stable-5.10' into stable-5.11Matthias Sohn2021-12-311-2/+38
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.10: Use FileSnapshot without using configs for FileBasedConfig Change-Id: Ie3f2d05aeb1aa04af707cfafef5780349be4d981
| | | | * Merge branch 'stable-5.9' into stable-5.10Matthias Sohn2021-12-311-2/+38
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.9: Use FileSnapshot without using configs for FileBasedConfig Change-Id: I4f954c48ad6e8ff18826fdc72d225bff3e3ae2d9
| | | | | * Merge branch 'stable-5.8' into stable-5.9Matthias Sohn2021-12-301-2/+38
| | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.8: Use FileSnapshot without using configs for FileBasedConfig Change-Id: Ic97d38fc85daa00297abbfa186f83b779966e7ef
| | | | | | * Merge branch 'stable-5.7' into stable-5.8stable-5.8Matthias Sohn2021-12-301-2/+38
| | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.7: Use FileSnapshot without using configs for FileBasedConfig Change-Id: If9cc2f2bae5dbead7a38218828da461540be942e
| | | | | | | * Merge branch 'stable-5.6' into stable-5.7stable-5.7Matthias Sohn2021-12-301-2/+38
| | | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.6: Use FileSnapshot without using configs for FileBasedConfig Change-Id: I274d46d73cc896dcfde6e24c69c71f33aaa78d20
| | | | | | | | * Merge branch 'stable-5.5' into stable-5.6stable-5.6Matthias Sohn2021-12-301-2/+38
| | | | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.5: Use FileSnapshot without using configs for FileBasedConfig Change-Id: If904289feecd1e0d8466c1fb998f160f14d54b61
| | | | | | | | | * Merge branch 'stable-5.4' into stable-5.5stable-5.5Matthias Sohn2021-12-301-2/+38
| | | | | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.4: Use FileSnapshot without using configs for FileBasedConfig Change-Id: I84e11bdaa9306e23212dac9d8670557a18d40107
| | | | | | | | | | * Merge branch 'stable-5.3' into stable-5.4stable-5.4Matthias Sohn2021-12-301-2/+38
| | | | | | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.3: Use FileSnapshot without using configs for FileBasedConfig Change-Id: I3d8eb2fa721e1a791db47a2342acc690ced01715
| | | | | | | | | | | * Merge branch 'stable-5.2' into stable-5.3stable-5.3Matthias Sohn2021-12-301-2/+38
| | | | | | | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.2: Use FileSnapshot without using configs for FileBasedConfig Change-Id: Ib79c310c5b632e845ba69ce65e739ae0146103ca
| | | | | | | | | | | | * Merge branch 'stable-5.1' into stable-5.2stable-5.2Matthias Sohn2021-12-301-2/+38
| | | | | | | | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.1: Use FileSnapshot without using configs for FileBasedConfig Change-Id: I17ede8876a0cf231c38cb9652c7bf51553b1e90e
| | | | | | | | | | | | | * Use FileSnapshot without using configs for FileBasedConfigstable-5.1Luca Milanesio2021-12-301-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FileBasedConfig should not rely on auto-detection of the file-snapshot attribute computation based on config. The check was already performed when a new FileBasedConfig is created at L158: // don't use config in this snapshot to avoid endless recursion newSnapshot = FileSnapshot.saveNoConfig(getFile()); The check was missing though when the FileBasedConfig is saved to disk and the new snapshot is obtained from the associated LockFile. This change fixes the issue by keeping a non-config based FileSnapshot also after a FileBasedConfig is saved. Bug: 577983 Change-Id: Id1e410ba687e683ff2b2643af31e1110b103b356
| | | | | | * | | | | | | | Merge branch 'stable-5.7' into stable-5.8Matthias Sohn2021-12-041-1/+1
| | | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.7: Add missing @since tags Add missing @since tag Add missing @since tags Remove unused import in ApacheSshTest Update maven plugins Ignore missing javadoc in test bundles storage: file: De-duplicate File.exists()+File.isFile() RefDirectory.scanRef: Re-use file existence check done in snapshot creation FileSnapshot: Lazy load file store attributes cache Update eclipse-jarsigner-plugin to 1.3.2 Fix p2 repository URLs Change-Id: Ibe46e8479b57a54591ad7bd3cc29bf4a5274e43d
| | | | | | | * | | | | | | Merge branch 'stable-5.6' into stable-5.7Matthias Sohn2021-12-041-1/+1
| | | | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.6: Add missing @since tag Add missing @since tags Remove unused import in ApacheSshTest Update maven plugins Ignore missing javadoc in test bundles storage: file: De-duplicate File.exists()+File.isFile() RefDirectory.scanRef: Re-use file existence check done in snapshot creation FileSnapshot: Lazy load file store attributes cache Update eclipse-jarsigner-plugin to 1.3.2 Fix p2 repository URLs Change-Id: I53e6cb4b3a34b32d964e486c1ff3d130eed6e406
| | | | | | | | * | | | | | Merge branch 'stable-5.5' into stable-5.6Matthias Sohn2021-12-041-1/+1
| | | | | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.5: Add missing @since tags Remove unused import in ApacheSshTest Update maven plugins Ignore missing javadoc in test bundles storage: file: De-duplicate File.exists()+File.isFile() RefDirectory.scanRef: Re-use file existence check done in snapshot creation FileSnapshot: Lazy load file store attributes cache Update eclipse-jarsigner-plugin to 1.3.2 Fix p2 repository URLs Change-Id: I007e92c12fde8d765b75f103e9d530aa0834b7d7
| | | | | | | | | * | | | | Merge branch 'stable-5.4' into stable-5.5Matthias Sohn2021-12-041-1/+1
| | | | | | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.4: Remove unused import in ApacheSshTest Update maven plugins Ignore missing javadoc in test bundles storage: file: De-duplicate File.exists()+File.isFile() RefDirectory.scanRef: Re-use file existence check done in snapshot creation FileSnapshot: Lazy load file store attributes cache Update eclipse-jarsigner-plugin to 1.3.2 Fix p2 repository URLs Change-Id: I5ce55c6c152a59602fef9fb08c16dedf666444e2
| | | | | | | | | | * | | | Merge branch 'stable-5.3' into stable-5.4Matthias Sohn2021-12-041-1/+1
| | | | | | | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.3: Remove unused import in ApacheSshTest Update maven plugins Ignore missing javadoc in test bundles storage: file: De-duplicate File.exists()+File.isFile() RefDirectory.scanRef: Re-use file existence check done in snapshot creation FileSnapshot: Lazy load file store attributes cache Update eclipse-jarsigner-plugin to 1.3.2 Fix p2 repository URLs Change-Id: I0e80612c8ddb934466105312f9107e91d581de0b
| | | | | | | | | | | * | | Merge branch 'stable-5.2' into stable-5.3Matthias Sohn2021-12-041-1/+1
| | | | | | | | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.2: Remove unused import in ApacheSshTest Update maven plugins Ignore missing javadoc in test bundles storage: file: De-duplicate File.exists()+File.isFile() RefDirectory.scanRef: Re-use file existence check done in snapshot creation FileSnapshot: Lazy load file store attributes cache Update eclipse-jarsigner-plugin to 1.3.2 Fix p2 repository URLs Change-Id: Id989365446cb55b9188e02e6e1f8cbc8ab71071c
| | | | | | | | | | | | * | Merge branch 'stable-5.1' into stable-5.2Matthias Sohn2021-12-041-1/+1
| | | | | | | | | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.1: Update maven plugins Ignore missing javadoc in test bundles storage: file: De-duplicate File.exists()+File.isFile() RefDirectory.scanRef: Re-use file existence check done in snapshot creation FileSnapshot: Lazy load file store attributes cache Update eclipse-jarsigner-plugin to 1.3.2 Fix p2 repository URLs Change-Id: If3ad2cfb6c341b0ff5c2120a5a1646f6368d86e7
| | | | | | | | | | | | | * Ignore missing javadoc in test bundlesMatthias Sohn2021-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I83ed20823dc6b22ff48c2a554acb2f7d3b6067b7 (cherry picked from commit 12f39c26b09bc3ebf1dd0216f56c37c808a53034)
* | | | | | | | | | | | | | Merge branch 'stable-5.13' into stable-6.0Thomas Wolf2021-12-261-0/+20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: Revert "RefDirectory.scanRef: Re-use file existence check done in snapshot creation" TreeRevFilter: fix wrong stop when the given path disappears Change-Id: Ibd69e9d941ad9262b61dd0c4368e48cb82597a12 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| * | | | | | | | | | | | | TreeRevFilter: fix wrong stop when the given path disappearskylezhao2021-12-171-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When chgs[i] == adds[i], it indicated that a commit added some files that pList[i] did not have, but didn't mean pList[i] is "empty tree root". Follow the example below: . . └── src └── src └── d1 ==> └── d1 └─ file1 ├─ file1 └── file2 c.parents[i] c The variable chg[i] equals to variable add[i], but commit c.parents[i] is not "empty tree root". We should add an additional check for no paths matching the filter. Bug: 577227 Change-Id: I834e9ddd0de86b108b280a1139519ea962913b38 Signed-off-by: kylezhao <kylezhao@tencent.com>
* | | | | | | | | | | | | | Prepare 6.0.1-SNAPSHOT buildsMatthias Sohn2021-11-292-56/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Iddb67ed9578293b83b8147aa18dd8319426f83d1
* | | | | | | | | | | | | | JGit v6.0.0.202111291000-rv6.0.0.202111291000-rMatthias Sohn2021-11-292-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I6441d9226e8131552bfafe1fb2c353f2e07e42ac Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | | | | | | | Don't block in GC#gc until garbage collection finishedMatthias Sohn2021-11-2815-66/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let GC#gc return collection of newly created packs as CompletableFuture to enable using gc() asynchronously. Change-Id: I3627014fd458c738cfe54225e631d6f7d9cfb1a7
* | | | | | | | | | | | | | Don't use deprecated Repository#getAllRefs in FileRepositoryMatthias Sohn2021-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also expose the potentially IOException thrown by RefDatabase#getRefs. Hence the following methods now potentially throw IOException: - AdvertiseRefsHook#advertiseRefs - ReceivePack#setAdvertisedRefs - Repository#getAdditionalHaves Bug: 534731 Change-Id: I85bc6ce5815d40be5f80042c53f4663072d96be5
* | | | | | | | | | | | | | Prepare 6.0.0-SNAPSHOT buildsMatthias Sohn2021-11-242-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I4e06186cf62681767962e391331cc65bafddc205
* | | | | | | | | | | | | | JGit v6.0.0.202111241155-rc1v6.0.0.202111241155-rc1Matthias Sohn2021-11-242-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I35dc089a00ee12f83f506fb320d23762fa030063 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | | | | | | | [6.0 API cleanup] Public interface for PackLockThomas Wolf2021-11-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide a public interface PackLock exposing only the unlock() method. Rename the internal PackLock class to PackLockImpl and have it implement the new interface. This way PackParser doesn't expose an internal class via its API anymore, and client can still unlock pack locks that were created. Bug: 576340 Change-Id: I976739f4ab28fe1f9ba7f35653a69a913aa68841 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | | | | | | | | | Support commit.template config propertyJulian Ruppel2021-11-221-7/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes an issue that commit template file could not be found if it has a relative path instead of absolute path. Relative path is probably common if git config --local is used. Bug: 446355 Change-Id: I8ddf2be672647be825fd9c01af82809d31bb8356
* | | | | | | | | | | | | | DFS block cache: harden against race over ref locks.Alina Djamankulova2021-11-161-26/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With change https://git.eclipse.org/r/c/jgit/jgit/+/186455 a thread loading a bitmap index could hold two ref locks at the same time (one for bitmap and one for either index or reverse index). So it is possible that two threads loading bitmaps end up in a deadlock for ref locks e.g. threadA has refLock[1] (for bitmap) and wants refLock[2] (for index or revIndex) and threadB has refLock[2] (for bitmap) and wants refLock[1]. This change introduces separate pools of locks per pack extension instead of a shared pool. So threads loading bitmap can hold two locks but with different extensions and no overlap, e.g. threadA holds refLock[BITMAP_INDEX][1] and refLock[INDEX][2] and threadB holds refLock[BITMAP_INDEX][2] and refLock[INDEX][1]. More unit tests were added to cover various paralell loading scenarios. Signed-off-by: Alina Djamankulova <adjama@google.com> Change-Id: I89704b4721c21548929608d3798ef60925280755
* | | | | | | | | | | | | | OpenSshConfigFile: line comments and quoted stringsThomas Wolf2021-11-151-2/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bring our SSH config parser up-to-date with respect to changes in OpenSSH. In particular, they fixed[1] the handling of line comments such that #-characters inside strings are not considered. This means that we have to parse strings with escaped quotes correctly. [1] https://bugzilla.mindrot.org/show_bug.cgi?id=3288 Change-Id: Ifbd9014127e8d51e7c8792e237f3fc2a9a0719d2 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | | | | | | | | | [test] test OpenSshConfigFile directly, not via the JSch configThomas Wolf2021-11-042-0/+606
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a prerequisite for removing the JSch support bundle; otherwise OpenSshConfigFile would be left without tests. Copy OpenSshConfigTest from the JSch support bundle and adapt all tests to perform the equivalent checks on OpenSshConfigFile directly. Add a new lookupDefault() method to the SshConfigStore interface and implement it so that it behaves the same and the tests work identically. Change-Id: I046abd9197a8484003e77005024e5d973456f1a3
* | | | | | | | | | | | | | Binary and CR-LF detection: lone CRs -> binaryThomas Wolf2021-10-313-40/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C git considers not only files containing NUL bytes as binary but also files containing lone CRs. Implement this also for JGit. C git additionally counts printable vs. non-printable characters and considers files that have non_printable_count > printable_count / 128 also as binary. This is not implemented because such counting probably only makes sense if one looks at the full file or blob content. The Auto[CR]LF* streams in JGit look only at the first few KiB of a stream in order not to buffer too much. For the C git implementation, see [1]. [1] https://github.com/git/git/blob/7e27bd589d/convert.c#L35 Bug: 576971 Change-Id: Ia169b59bdbf1477f32ee2014eeb8406f81d4b1ab Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | | | | | | | | | Factor out parsing git-style size numbers to StringUtilsThomas Wolf2021-10-301-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the code to parse numbers with an optional 'k', 'm', or 'g' suffix from the config file handling to StringUtils. This enables me to re-use it in EGit, which has duplicate code in StorageSizeFieldEditor. As this is generally useful functionality, providing it in the library makes sense. Change-Id: I86e4f5f62e14f99b35726b198ba3bbf1669418d9 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | | | | | | | | | Make the buffer size for text/binary detection configurableThomas Wolf2021-10-304-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The various streams used in JGit for text/binary and CR-LF detection used different buffer sizes. Most used 8000, but one used 8KiB, and one used 8096 (SIC!) bytes. Considering only the first 8kB of a file/blob is not sufficient; it may give behavior incompatible with C git. C git considers the whole blob; since it uses memory-mapped files it can do so with acceptable performance. Doing this in JGit would most likely incur a noticeable performance penalty. But 8kB is a bit small; in the file in bug 576971 the limit was hit before the first CR-LF, which occurred on line 155 at offset 9759 in the file. Make RawText.FIRST_FEW_BYTES only a default and minimum setting, and set it to 8KiB. Make the actual buffer size configurable: provide static methods getBufferSize() and setBuffersize(), and use getBufferSize() throughout instead of the constant. This enables users of the JGit library to set their own possibly larger buffer size. Bug: 576971 Change-Id: I447762c9a5147a521f73d2864ba59ed89f555d54 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | | | | | | | | | Fix checkout of files with mixed line endings on text=auto eol=crlfThomas Wolf2021-10-273-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add tests for files having been checked in with mixed LF and CR-LF line endings, and then being checked out with text or text=auto and eol=lf or eol=crlf. These test cases were missing, and thus commit efd1cc05 missed that AutoCRLFOutputStream needs the same detection as AutoLFOutputStream. Fix AutoCRLFOutputStream to not convert line endings if the blob in the repository contains CR-LF. Bug: 575393 Change-Id: Id0c7ae772e282097e95fddcd3f1f9d82aae31e43 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | | | | | | | | | Don't rely on an implicit default character setThomas Wolf2021-10-261-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JEP 400 (Java 18) will change the default character set to UTF-8 unconditionally.[1] Introduce SystemReader.getDefaultCharset() that provides the locale-dependent charset the way JEP 400 recommends. Change all code locations using Charset.defaultCharset() to use the new SystemReader method instead. [1] https://openjdk.java.net/jeps/400 Change-Id: I986f97a410d2fc70748b6f93228a2d45ff100b2c Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | | | | | | | | | DFS block cache: fix lock issue and support parallel index loadingAlina Djamankulova2021-10-191-2/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is a fix to http://git.eclipse.org/r/c/jgit/jgit/+/183562 that was reverted in http://git.eclipse.org/r/c/jgit/jgit/+/184978 due to deadlocks. Separate locks in DfsBlockFile are removed to rely on getting value from DfsBlockCache with region locking in place. With this change bitmap index creation is not blocked on index and reverse index full initialization in DfsPackFile. Now bitmap index and index could be read from storage in parallel in separate threads. A unit test is added for parallel index loading. Signed-off-by: Alina Djamankulova <adjama@google.com> Change-Id: Ic6d9c5a4a254628636aa98a5008447a27a003f69
* | | | | | | | | | | | | | Merge branch 'stable-5.13'Matthias Sohn2021-10-155-13/+177
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: Fix missing peel-part in lsRefsV2 for loose annotated tags Fix RevWalk.getMergedInto() ignores annotated tags Optimize RevWalk.getMergedInto() reftable: drop code for truncated reads reftable: pass on invalid object ID in conversion Update eclipse-jarsigner-plugin to 1.3.2 Fix running benchmarks from bazel Update eclipse-jarsigner-plugin to 1.3.2 Add org.bouncycastle.bcutil to p2 repository Change-Id: I789e3c84045cc9dcd8a26de34d09fc1e3ccc41e7
| * | | | | | | | | | | | | Merge branch 'stable-5.12' into stable-5.13Matthias Sohn2021-10-155-13/+177
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.12: Fix missing peel-part in lsRefsV2 for loose annotated tags Fix RevWalk.getMergedInto() ignores annotated tags Optimize RevWalk.getMergedInto() reftable: drop code for truncated reads reftable: pass on invalid object ID in conversion Update eclipse-jarsigner-plugin to 1.3.2 Fix running benchmarks from bazel Update eclipse-jarsigner-plugin to 1.3.2 Change-Id: Ie5da8d2d07f39ab5aaeca560040637635d4eb04c
| | * | | | | | | | | | | | Merge branch 'stable-5.11' into stable-5.12Matthias Sohn2021-10-153-10/+142
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.11: Fix missing peel-part in lsRefsV2 for loose annotated tags reftable: drop code for truncated reads reftable: pass on invalid object ID in conversion Update eclipse-jarsigner-plugin to 1.3.2 Fix running benchmarks from bazel Update eclipse-jarsigner-plugin to 1.3.2 Change-Id: I2122b3966bddb10d43d439eb8c5d6cc4583c6ba6
| | | * | | | | | | | | | | Merge branch 'stable-5.10' into stable-5.11Matthias Sohn2021-10-153-10/+142
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.10: Fix missing peel-part in lsRefsV2 for loose annotated tags reftable: drop code for truncated reads reftable: pass on invalid object ID in conversion Update eclipse-jarsigner-plugin to 1.3.2 Fix running benchmarks from bazel Update eclipse-jarsigner-plugin to 1.3.2 Change-Id: I23ccb89306263ce042ce782d881812d4b5187672
| | | | * | | | | | | | | | Merge branch 'stable-5.9' into stable-5.10Matthias Sohn2021-10-153-10/+142
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.9: Fix missing peel-part in lsRefsV2 for loose annotated tags reftable: drop code for truncated reads reftable: pass on invalid object ID in conversion Update eclipse-jarsigner-plugin to 1.3.2 Fix running benchmarks from bazel Update eclipse-jarsigner-plugin to 1.3.2 Change-Id: I4e7c7727ebfa9a7748477f2300bd66d775548ad6
| | | | | * | | | | | | | | Fix missing peel-part in lsRefsV2 for loose annotated tagsSaša Živkov2021-10-151-0/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We observed the following issue: $ git tag -a v1.0 -m v1.0 $ git push origin tag v1.0 $ git ls-remote origin v1.0^{} ... empty result ... On the server (Gerrit) side run git-gc to pack the refs: $ git gc Repeat the ls-remote from the client and the result is correct: $ git ls-remote origin v1.0^{} 7ad85c810de3ae922903d4bdd17c53cd627260ba refs/tags/v1.0^{} Unfortunately, the existing UploadPackTest didn't reveal this issue although it provided the test case needed to do so: testV2LsRefsPeel. This is because The UploadPackTest uses InMemoryRepository which internally uses Dfs* implementations. The issue is only reproducible when using the FileRepository. It is a non-trivial task to refactor the UploadPackTest to work against both InMemoryRepository and FileRepository and this change is not trying to do that. This change creates a new test: UploadPackLsRefsFileRepositoryTest and copies the necesssary code from the UploadPackTest. Change-Id: Icfc7d0ca63f1524bafe24c9626ce12ea72aa3718 Signed-off-by: Saša Živkov <sasa.zivkov@sap.com>
| | | | | * | | | | | | | | Merge branch 'stable-5.8' into stable-5.9Matthias Sohn2021-10-082-10/+19
| | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.8: reftable: drop code for truncated reads reftable: pass on invalid object ID in conversion Update eclipse-jarsigner-plugin to 1.3.2 Change-Id: I9e66ef90dc9a65bac47b35705d679bf992bd72b9
| | | | | | * | | | | | | | Merge branch 'stable-5.7' into stable-5.8Matthias Sohn2021-10-082-10/+19
| | | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.7: reftable: drop code for truncated reads reftable: pass on invalid object ID in conversion Update eclipse-jarsigner-plugin to 1.3.2 Change-Id: I88c47ff57f4829baec5b19aad3d8d6bd21f31a86
| | | | | | | * | | | | | | Merge branch 'stable-5.6' into stable-5.7Matthias Sohn2021-10-082-10/+19
| | | | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.6: reftable: drop code for truncated reads reftable: pass on invalid object ID in conversion Update eclipse-jarsigner-plugin to 1.3.2 Change-Id: I1c18f5f435f4a4a86e0548a310dbfc74191e1ed5