aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | | | Config: add getters for primitive types without default valueMatthias Sohn2025-02-065-44/+527
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which return null if the option is not configured. Change-Id: I0d444b396458f49712e35ef32427dc45ee3f8ec8
| | * | | | | CommitConfig: fix potential NPEMatthias Sohn2025-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The local variable `comment` is null if the option core.commentChar is unset. Change-Id: I907dabff395f75b3a6367446389df395b28f027a
| * | | | | | midx.PackIndexMerger: Helper to iterate over n-indexesIvan Frade2025-02-035-0/+649
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The multipack index can be build merging the individual pack indexes and handling correctly the duplicates. PackIndexMerger is a utility function that gathers n-indexes and allows to iterate as one with the correct sha1 order. It also precalculates some of the needed metadata (as count of objects without duplicates, or if offsets go over 32 bits). Change-Id: I515b70fffff4489d83834488daf975f85726ea96
| * | | | | PackIndex.MutableEntry: new methods to copy its contentsIvan Frade2025-02-032-28/+91
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To build the multipack index, we will iterate over N indexes merging the results in sha1 order. With the current MutableEntry API, we need to create an instance of ObjectId to either compare and/or copy the selected entry to the multi index iterator. Allow MutableEntries to compare to each other without creating any new object, and copy their object id directly to another MutableObjectId. This allows to build other iterators with mutable entries that copy the required memory (few ints) instead of creating short-lived instances of ObjectId. Change-Id: I0c0091420d7c0847c03afdc9e73b566bb4eeba40
| * | | | Merge branch 'stable-7.2'Matthias Sohn2025-02-013-30/+85
| |\ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.2: RevWalk: Add an isMergedIntoAnyCommit() method Prepare 7.2.0-SNAPSHOT builds JGit v7.2.0.202501291320-m2 Pack: separate an open/close accounting lock http.server/BUILD: expose servlet resources as target Change-Id: I285979539d57f3a079ad7902ba82fe5d17de1069
* | | | | Merge branch 'stable-7.1' into stable-7.2Matthias Sohn2025-02-013-30/+85
|\ \ \ \ \ | | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.1: RevWalk: Add an isMergedIntoAnyCommit() method Pack: separate an open/close accounting lock http.server/BUILD: expose servlet resources as target Change-Id: Ie53048a5154a4a40f7c0f9da3b8b829d305ab323
| * | | | Merge branch 'stable-7.0' into stable-7.1Matthias Sohn2025-02-014-31/+91
| |\ \ \ \ | | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: RevWalk: Add an isMergedIntoAnyCommit() method Pack: separate an open/close accounting lock http.server/BUILD: expose servlet resources as target Change-Id: I25d3ffe86150d4d9e8a54634145cdbee34ea15fb
| | * | | Merge branch 'stable-6.10' into stable-7.0Matthias Sohn2025-02-014-31/+91
| | |\ \ \ | | | | |/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: RevWalk: Add an isMergedIntoAnyCommit() method Pack: separate an open/close accounting lock http.server/BUILD: expose servlet resources as target Change-Id: Icda1b3dbc79c47d5dcc45932fe452fcf66e35657
| | | * | RevWalk: Add an isMergedIntoAnyCommit() methodMartin Fick2025-02-013-9/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RevWalk had a bulk isMergedIntoAny() method, however it worked only for Refs. Add a similar method which works for RevCommits instead. Unfortunately isMergedIntoAny() cannot be overloaded since java does not include the generic types in Collections of method signatures, so the method name needs to be more complicated to differentiate it from the existing method. Change-Id: I4f8f3a83058a186fafe3b37726e21c5074a6b8e1 Signed-off-by: Martin Fick <mfick@nvidia.com>
| | | * | Pack: separate an open/close accounting lockMartin Fick2024-12-201-21/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the open/close accounting code used whole Pack object synchronization for locking. Unfortunately, there are other unrelated methods which use whole Pack object synchronization also, mostly to avoid concurrent loading of these independent indices, and they do not touch or need to coordinate with the open/close accounting data. During heavy load when a new file appears after repacking the readFully() threads could uselessly block on threads reading the reverse index. These threads could have been reading from the Pack file instead of waiting for the reverse index to be read. Use a new lock to make this locking more fine grained to prevent the readFully() calling threads from getting blocked in beginWindowCache() while the reverse index or bitmaps are being loaded. Change-Id: I7ac9067ca10cd6d6be0ab25148d99da3ace7ba36 Signed-off-by: Martin Fick <mfick@nvidia.com>
| | | * | http.server/BUILD: expose servlet resources as targetIvan Frade2024-12-201-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JGit has moved to jakarta servlet-api, but gerrit is still in the javax version. This is blocking gerrit to update their jgit code. Gerrit can workaround this rebuilding the jar of jgit-servlet but it is complicated to pass-through the resources. Expose the resources of the servlet as a target, to help gerrit build a javax version of the jgit-servlet. Change-Id: Ifd794e4222ad442f4a538a4d38caa73d58be0f6d (cherry picked from commit 31db36bbea6d081c8714a4c7ed3f5d81112ae8b8)
* | | | | Prepare 7.2.0-SNAPSHOT buildsMatthias Sohn2025-01-2989-123/+123
| | | | | | | | | | | | | | | | | | | | Change-Id: I646edcba7809ab91d8e0a933796b4b5c81736232
* | | | | JGit v7.2.0.202501291320-m2v7.2.0.202501291320-m2Matthias Sohn2025-01-2989-123/+123
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: I4e4e203c0f6a2463adefd28d3965eaf44bd2e620
| | | | * PackDirectory: make template variables names more readableLuca Milanesio2025-01-301-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up of I57b24ffb0b3 addressing a readability issue on the variable names of the PackDirectory.handlePackError() method. Change-Id: I877a45328e9b7026e66f300c363ea5c1625af157
| | | | * Merge "Log pruned packfiles as debug and not warn logs"Matthias Sohn2025-01-291-1/+5
| | | | |\
| | | | | * Log pruned packfiles as debug and not warn logsLuca Milanesio2025-01-291-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the regular lifecycle of a Git repository, the packfiles are constantly created and removed as part of repacking and pruning. Lower the logging of disappearing packfiles to debug level to reduce the SPAMing on logfile with warnings that should be ignored as part of the normal repository life. Change-Id: I57b24ffb0b32f7a64810cab47b5009f2bf89a6b8
| | | | * | LooseObjects: compute loose object path before retry loopMatthias Sohn2025-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's unnecessary to recompute this for retries. Change-Id: I383ecfa25d795ba177dd5ce14d12b318e38daf9b
| | | | * | LooseObjects: convert while loop into for loopMatthias Sohn2025-01-291-6/+4
| |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | to simplify the implementation and shorten variable names. Change-Id: I84c038e65263b7d0c38c4e90817ab8b07ad5c2da
* | | | | Merge "ArchiveCommandTest: add missing package import"Matthias Sohn2025-01-291-0/+1
|\ \ \ \ \
| * | | | | ArchiveCommandTest: add missing package importMatthias Sohn2024-12-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Transitive dependency to org.apache.commons.lang3 was missing when running tests in Eclipse. Change-Id: I364fabc8b76f5401e400e1bf6dcb4fa400ee0494
* | | | | | Merge "Use junit TemporaryFolder to cleanup files created by tests"Matthias Sohn2025-01-292-50/+25
|\ \ \ \ \ \
| * | | | | | Use junit TemporaryFolder to cleanup files created by testsMatthias Sohn2025-01-052-50/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The custom code used earlier sometimes failed to cleanup files created by tests. Hence replace it by using TemporaryFolder. Change-Id: I8c1219b01835a4a6d20498ab04555af024e4e624
* | | | | | | Submodules: Update submodule with deleted worktreeSimon Eder2025-01-293-55/+253
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation throws an exception when a submodule is updated for which the 'gitdir' still exists but the 'worktree' is missing. The current implementation tries to clone the submodule but fails as the 'gitdir' is not empty. The commit adds: - a check if the 'gitdir' is empty - if the 'gitdir' is not empty: - create a new '.git' file linking to the existing 'gitdir' - fetch the submodule - checkout the submodule unconditionally (ignore any configured update mode) - if the submodule is cloned checkout the submodule unconditionally (ignore any configured update mode) This change mimics the behavior of cgit. Bug: jgit-79 Change-Id: Iffc8659d2a04d866a43815c78c7760c0f3d82640
* | | | | | [ssh signing] AllowedSigners: fix validity checkThomas Wolf2025-01-282-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all SSH key types start with "ssh-" (for instance ECDSA keys). Don't test for this; instead test that the string we want to use as base64-encoded key starts with "AAAA". Change-Id: Ia0e24d63c69c98813ac7419f4a688f3d15139a10
* | | | | | Merge "junit.FakeIndexFactory: Easy fake indexes for tests"Ivan Frade2025-01-281-0/+243
|\ \ \ \ \ \
| * | | | | | junit.FakeIndexFactory: Easy fake indexes for testsIvan Frade2025-01-271-0/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Utility to create fake indexes. This simplify unit testing code that requires an index. Change-Id: I30f60cbd37ad5b48f4d919be265bfbf9a7fe57c4
* | | | | | | Merge changes I5e7323c6,I5e66a512,I0859990fMatthias Sohn2025-01-2828-234/+394
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: RefDatabase#getReflogReader(String): use #exactRef to resolve refName Deprecate Repository#getReflogReader methods Add RefDatabase#getReflogReader methods
| * | | | | | RefDatabase#getReflogReader(String): use #exactRef to resolve refNameMatthias Sohn2025-01-2710-60/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't accept short ref names anymore which is more predictable. Change-Id: I5e7323c610c68b25facd6f2286456716d8e6cf1a
| * | | | | | Deprecate Repository#getReflogReader methodsMatthias Sohn2025-01-2722-191/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead use Repository.getRefDatabase().getReflogReader(). Change-Id: I5e66a512c12e11d0ec3275fffde4adb8483430f2
| * | | | | | Add RefDatabase#getReflogReader methodsMatthias Sohn2025-01-278-33/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to fix broken abstraction in FileRepository#getReflogReader(String). How to get a ReflogReader depends on the chosen RefDatabase implementation, hence the #getReflogReader methods should be there. This also fixes a bug in FileRepository#getReflogReader(Ref) which didn't work if FileReftableDatabase was used as RefDatabase since it always returned the implementation only suitable for RefDirectory. Change-Id: I0859990f9390ab96596b6c344966c687dfbbf167
* | | | | | | Merge "Fix ObjectDirectoryTest#testOpenLooseObjectPropagatesIOExceptions"Matthias Sohn2025-01-271-6/+11
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | |
| * | | | | | Fix ObjectDirectoryTest#testOpenLooseObjectPropagatesIOExceptionsMatthias Sohn2025-01-171-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By instrumenting "LooseObjects#open" with print statements (since debugging mocks doesn't work in Eclipse) I found that the constructor "LooseObjects(Config, File)" which defaults "core.trustFolderStat" to "true" isn't used when mocking LooseObjects. Hence "core.trustFolderStat" is in fact "false" in the mocked LooseObjects object. Make this explicit by configuring "trustFolderStat=false" in a real "LooseObjects" object and only mock its method "#getObjectLoader" using a spy. Change-Id: I2f870637db818c2e89c1c2a174bf78bd572a367a
* | | | | | | Update org.assertj:assertj-core to 3.27.3Matthias Sohn2025-01-277-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I513ed40eded5abe8511494875eeb6849592c643e
* | | | | | | Update bytebuddy to 1.16.1Matthias Sohn2025-01-267-18/+18
|/ / / / / / | | | | | | | | | | | | | | | | | | Change-Id: I3cb485de38d338735ee7856ab18789dc9f9dfb60
* | | | | | Add target platform jgit-4.35 for Eclipse 2025-03Matthias Sohn2025-01-163-0/+325
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I4211fe2529638509865624fe69332b3b5b67bfe1
* | | | | | Update bouncycastle to 1.80Matthias Sohn2025-01-166-29/+25
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I4bd82f562c8b7d4e9b934bc0a0519f4060c81d12
* | | | | | Update Apache commons-codec to 1.17.2Matthias Sohn2025-01-166-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ibec1f2821d82855337e166bc65afd7c5b98dc5f2
* | | | | | Merge "FileReftableTest: fix order of arguments when using assertEquals"Matthias Sohn2025-01-091-16/+16
|\ \ \ \ \ \
| * | | | | | FileReftableTest: fix order of arguments when using assertEqualsMatthias Sohn2025-01-061-16/+16
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The expected value is the first argument and the actual value the second argument. Change-Id: I8416cfeaa7a14d0b863658bf133473535647fc57
* / / / / / Set repositoryformatversion=0 when converting refStorage to filesyoutirsin2025-01-091-0/+2
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://git-scm.com/docs/repository-version#_version_1 Change-Id: Ic71e55f5dfd4dacedabe54a5881a56b72659f3bc Signed-off-by: youtirsin <youtirsin@qq.com>
* | | | | Update org.assertj:assertj-core to 3.27.2Matthias Sohn2025-01-056-10/+10
| | | | | | | | | | | | | | | | | | | | Change-Id: I8389402492f0729837f0aa2d41f1f69eb1b27334
* | | | | Update mockito to 5.15.2Matthias Sohn2025-01-036-10/+10
| | | | | | | | | | | | | | | | | | | | Change-Id: Ic0e65e2ccd5dbd7298d8fb425a67368371462be6
* | | | | Update org.assertj:assertj-core to 3.27.1Matthias Sohn2025-01-036-10/+10
| | | | | | | | | | | | | | | | | | | | Change-Id: I90999c8d67adce2d510c2dc2d428090a1890c6ff
* | | | | Update jna to 5.16.0Matthias Sohn2025-01-036-15/+15
| | | | | | | | | | | | | | | | | | | | Change-Id: I1b3ac396297968174f46afda70e7292eed19210d
* | | | | WriteReftable: replace deprecated PersonIdent constructorMatthias Sohn2024-12-291-2/+5
| | | | | | | | | | | | | | | | | | | | Change-Id: I70e9980bd7337f3f3e7c709fe16b91461cbbad7b
* | | | | SimpleMergeTest: replace deprecated PersonIdent constructorMatthias Sohn2024-12-291-1/+4
| | | | | | | | | | | | | | | | | | | | Change-Id: Ic40473aecb23e22c755a9e041592886fb3c448f9
* | | | | RevCommitParseTest: : use java.time instead of java.util.Date APIMatthias Sohn2024-12-291-10/+15
| | | | | | | | | | | | | | | | | | | | Change-Id: I6cf6ed64b4029001cb5908338b60385804eb9997
* | | | | PushCertificateStoreTest: replace deprecated PersonIdent constructorMatthias Sohn2024-12-291-2/+4
| | | | | | | | | | | | | | | | | | | | Change-Id: I600538d0ea7ec4377af331341b8e4e2d51a5a51d
* | | | | ReftableTest: replace deprecated PersonIdent constructorMatthias Sohn2024-12-291-12/+26
| | | | | | | | | | | | | | | | | | | | Change-Id: I63c37a0fb0f6070aba3947903e79d8ebc014f52d
* | | | | ReflogWriterTest: replace deprecated PersonIdent constructorMatthias Sohn2024-12-291-1/+3
| | | | | | | | | | | | | | | | | | | | Change-Id: I8e1b82c76403493faa00ec1a30a6d57a695d8573