summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
* UploadPackTest: ensure UploadPack is closed to fix resource leakMatthias Sohn2022-11-211-37/+43
| | | | Change-Id: I4c8cf6041b4011934d338138d4531d190fdd6abb
* Fix warnings in PatchApplierTestMatthias Sohn2022-11-201-12/+12
| | | | | | | - don't use final for method parameters - fix hiding member warnigns Change-Id: I73c386f669918d3291ee3380024c018483aa3c97
* Fix boxing warnings in TransportTestMatthias Sohn2022-11-201-3/+3
| | | | Change-Id: I7e6dc845b89899cff262fab77c3977dbef5eea02
* Silence warnings about unclosed BasePackPushConnectionMatthias Sohn2022-11-201-0/+3
| | | | Change-Id: If52e8462e6222dd58d1004dd5ac174a27d96d098
* DfsStreamKey: Replace ForReverseIndex to separate metrics.Anna Papitto2022-11-171-7/+6
| | | | | | | | | | | | | | Keys used for identifying reverse indexes in the DfsBlockCache use a custom subclass ForReverseIndex because there was no PackExt for them. This conflates BlockCacheMetrics for reverse indexes with those for packs, since the key falls back onto 0 when there is no extension. Replace the custom ForReverseIndex with a DfsStreamKey usage to bring keys for the new REVERSE_INDEX extension in line with INDEX and BITMAP and separate reverse index and pack BlockCacheMetrics. Change-Id: I305e2c16d2a8cb2a824855ea92e0c9a9b188fce5 Signed-off-by: Anna Papitto <annapapitto@google.com>
* RawText.isBinary(): handle complete buffer correctlyThomas Wolf2022-11-161-0/+34
| | | | | | | Make sure we always get consistent results, whether or not we have the full data in the buffer. Change-Id: Ieb379a0c375ad3dd352e63ac2f23bda6ef16c215 Signed-off-by: Thomas Wolf <twolf@apache.org>
* Merge branch 'stable-6.3'Matthias Sohn2022-11-161-10/+59
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: [benchmarks] Remove profiler configuration Add SHA1 benchmark [benchmarks] Set version of maven-compiler-plugin to 3.8.1 Fix running JMH benchmarks Add option to allow using JDK's SHA1 implementation Fix API breakage caused by extracting WorkTreeUpdater Extract Exception -> HTTP status code mapping for reuse Don't handle internal git errors as an HTTP error Ignore IllegalStateException if JVM is already shutting down Allow to perform PackedBatchRefUpdate without locking loose refs Change-Id: Ib58879be292c54a2a7f4936ac0986997985c822b
| * Merge branch 'stable-6.2' into stable-6.3Matthias Sohn2022-11-161-10/+59
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.2: [benchmarks] Remove profiler configuration Add SHA1 benchmark [benchmarks] Set version of maven-compiler-plugin to 3.8.1 Fix running JMH benchmarks Add option to allow using JDK's SHA1 implementation Ignore IllegalStateException if JVM is already shutting down Change-Id: I9c1576011c11b4ff8f453d18d9e786cee59860fa
| | * Merge branch 'stable-6.1' into stable-6.2Matthias Sohn2022-11-161-10/+59
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: [benchmarks] Remove profiler configuration Add SHA1 benchmark [benchmarks] Set version of maven-compiler-plugin to 3.8.1 Fix running JMH benchmarks Add option to allow using JDK's SHA1 implementation Ignore IllegalStateException if JVM is already shutting down Change-Id: Ie433c46a01a0f33848d54ecf99b30a44ca01e286
| | | * Merge branch 'stable-6.0' into stable-6.1Matthias Sohn2022-11-161-10/+59
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: [benchmarks] Remove profiler configuration Add SHA1 benchmark [benchmarks] Set version of maven-compiler-plugin to 3.8.1 Fix running JMH benchmarks Add option to allow using JDK's SHA1 implementation Ignore IllegalStateException if JVM is already shutting down Change-Id: I176419026c3f4fdd8ebd34c61468c1ec3482ff45
| | | | * Merge branch 'stable-5.13' into stable-6.0Matthias Sohn2022-11-161-10/+59
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: [benchmarks] Remove profiler configuration Add SHA1 benchmark [benchmarks] Set version of maven-compiler-plugin to 3.8.1 Fix running JMH benchmarks Add option to allow using JDK's SHA1 implementation Ignore IllegalStateException if JVM is already shutting down Change-Id: I40105336f0b9e593a8a2c242a9557f854c274fdc
| | | | | * Add option to allow using JDK's SHA1 implementationMatthias Sohn2022-11-151-10/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change If6da9833 moved the computation of SHA1 from the JVM's JCE to a pure Java implementation with collision detection. The extra security for public sites comes with a cost of slower SHA1 processing compared to the native implementation in the JDK. When JGit is used internally and not exposed to any traffic from external or untrusted users, the extra cost of the pure Java SHA1 implementation can be avoided, falling back to the previous native MessageDigest implementation. Bug: 580310 Change-Id: Ic24c0ba1cb0fb6282b8ca3025ffbffa84035565e
* | | | | | Update Orbit to S20221109014815Matthias Sohn2022-11-142-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and update - com.sun.jna to 5.12.1.v20221103-2317 - com.sun.jna.platform to 5.12.1.v20221103-2317 - org.bouncycastle.bcpg to 1.72.0.v20221013-1810 - org.bouncycastle.bcpkix to 1.72.0.v20221013-1810 - org.bouncycastle.bcprov to 1.72.0.v20221013-1810 - org.bouncycastle.bcutil to 1.72.0.v20221013-1810 - org.mockito.mockito-core to 4.8.1.v20221103-2317 - org.objenesis to 3.3.0.v20221103-2317 Change-Id: If00094d23e51d5f66928f83c1334aa6b18b98dfe
* | | | | | UploadPack: Receive and parse client session-idJosh Brown2022-11-023-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change JGit did not support the session-id capability implemented by native Git in UploadPack. This change implements advertising the capability from the server and parsing the session-id received from the client during an UploadPack operation. Enable the transfer.advertisesid config setting to advertise the capability from the server. The client may send a session-id capability in response. If received, the value from this is parsed and available via the getClientSID method on the UploadPack object. This change does not add the capability to send a session-id from the JGit client. https://git-scm.com/docs/gitprotocol-capabilities#_session_idsession_id Change-Id: Ib1b6929ff1b3a4528e767925b5e5c44b5d18182f Signed-off-by: Josh Brown <sjoshbrown@google.com>
* | | | | | TransferConfig: Move reading advertisesid setting into TransferConfigJosh Brown2022-11-021-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The config setting to enable advertising the session-id capability is currently read in the ReceivePack class. This change moves it to a common location in the TransferConfig class so that it can be reused in other places like UploadPack. TransferConfig is also a more logical place for the setting as it resides in the `transfer` config section. Set the transfer.advertisesid setting to true to send the session-id capability to the client. Change-Id: If68ecb5e68b59f5c452a7992d02e3688b0a86747 Signed-off-by: Josh Brown <sjoshbrown@google.com>
* | | | | | FirstWant: Parse client session-id if received.Josh Brown2022-11-021-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In protocol V0 the client capabilities are appended to the first line. Parsing session-id is currently only supported during a ReceivePack operation. This change will parse the client session-id capability if it has been sent by the client. If the server sends the session-id capability to the client. The client may respond with a session ID of its own. FirstWant.fromLine will now parse the ID and make it available via the getClientSID method. This change does not add support to send the session-id capability from the server. The change is necessary to support session-id in UploadPack. Change-Id: Id3fe44fdf9a72984ee3de9cf40cc4e71d434df4a Signed-off-by: Josh Brown <sjoshbrown@google.com>
* | | | | | ReceivePack: Receive and parse client session-id.Josh Brown2022-10-271-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change JGit did not support the session-id capability implemented by native Git. This change implements advertising the capability from the server and parsing the session-id received from the client during a ReceivePack operation. Enable the transfer.advertisesid config setting to advertise the capability from the server. The client may send a session-id capability in response. If received, the value from this is parsed and available via the getClientSID method on the ReceivePack object. All capabilities in the form `capability=value` are now split into key value pairs at the first `=` character. This change replaces specific handling for the agent capability. This change does not add advertisement or parsing to UploadPack. This change also does not add the ability to send a session ID from the JGit client. https://git-scm.com/docs/protocol-v2/2.33.0#_session_idsession_id Change-Id: I56fb115e843b11b27e128c4ac427b05d5ec129d0 Signed-off-by: Josh Brown <sjoshbrown@google.com>
* | | | | | PushCommand: allow users to disable use of bitmaps for pushkylezhao2022-10-211-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reachability bitmaps are designed to speed up the "counting objects" phase of generating a pack during a clone or fetch. They are not optimized for Git clients sending a small topic branch via "git push". In some cases (see [1]), using reachability bitmaps during "git push" can cause significant performance regressions. Add PushCommand#setUseBitmaps(boolean) to allow users to tell "git push" not to use bitmaps. [1]: https://lore.kernel.org/git/87zhoz8b9o.fsf@evledraar.gmail.com/ Change-Id: I7fb7d26084ec63ddfa7249cf58abb85929b30e56 Signed-off-by: kylezhao <kylezhao@tencent.com>
* | | | | | I/O redirection for the pre-push hookThomas Wolf2022-10-201-1/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix and complete the implementation of calling the pre-push hook. Add the missing error stream redirect, and add the missing setters in Transport and in PushCommand. In Transport, delay setting up a PrePushHook such that it happens only on a push. Previously, the hook was set up also for fetches. Bug: 549246 Change-Id: I64a576dfc6b139426f05d9ea6654027ab805734e Signed-off-by: Thomas Wolf <twolf@apache.org>
* | | | | | PackParser: populate full size of the PackedObjectInfosIvan Frade2022-10-181-0/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need the full size of the objects to populate the object-size index of a pack. This size is not always the one encoded in the object header in the pack (e.g. for deltas). Populate the full size of PackedObjectInfos in the PackParser, which is invoked when receiving a pack e.g. in a push. Change-Id: I102c20901aefb5e85047e2e526c0d733f82ff74b
* | | | | | CloneCommand: set HEAD also when not checking outThomas Wolf2022-09-181-4/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CloneCommand, when setNoCheckout(true) was set, did not set HEAD. With C git, "git clone --no-checkout" does. Change-Id: Ief3df7e904ce90829a6345a6c3e9ee6a68486ab0 Signed-off-by: Thomas Wolf <twolf@apache.org>
* | | | | | Merge "Split out ApplyCommand logic to PatchApplier class"Han-Wen NIenhuys2022-09-152-386/+534
|\ \ \ \ \ \
| * | | | | | Split out ApplyCommand logic to PatchApplier classNitzan Gur-Furman2022-09-152-386/+534
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PatchApplier now routes updates through the index. This has two results: * we can now execute patches in-memory. * the JGit apply command will now always update the index to match the working tree. Change-Id: Id60a88232f05d0367787d038d2518c670cdb543f Co-authored-by: Han-Wen Nienhuys <hanwen@google.com> Co-authored-by: Nitzan Gur-Furman <nitzan@google.com>
* | | | | | | Prepare 6.4.0-SNAPSHOT buildsMatthias Sohn2022-09-142-58/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I47ca5f1d0263caa0bfc7c303042360c6c5ac4dec
* | | | | | | Merge branch 'stable-6.3'Matthias Sohn2022-09-129-742/+425
|\ \ \ \ \ \ \ | | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: Prepare 6.3.1-SNAPSHOT builds JGit v6.3.0.202209071007-r JGit v6.3.0.2022009070944-r [merge] Fix merge conflicts with symlinks Update DEPENDENCIES for 6.3.0 Update tycho to 2.7.5 Revert "Adds FilteredRevCommit that can overwrites its parents in the DAG." Revert "Option to pass start RevCommit to be blamed on to the BlameGenerator." Prepare 6.3.0-SNAPSHOT builds JGit v6.3.0.202208161710-m3 Change-Id: Ia9430fb516dca795e25064a190704b70689af364
| * | | | | | Prepare 6.3.1-SNAPSHOT buildsMatthias Sohn2022-09-122-58/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I44e159eca4131880d74d3078060e7e20f9b5ce76
| * | | | | | JGit v6.3.0.202209071007-rv6.3.0.202209071007-rMatthias Sohn2022-09-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: Iea3fae9f6f6c5fb0a79f7684334a3e0059738c4f
| * | | | | | JGit v6.3.0.2022009070944-rMatthias Sohn2022-09-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: I3cc78dbcf8c7970e80bf1499751611110ec2b30b
| * | | | | | [merge] Fix merge conflicts with symlinksThomas Wolf2022-09-071-0/+296
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous code would do a content merge on symlinks, and write the merge result to the working tree as a file. C git doesn't do this; it leaves a symlink in the working tree unchanged, or in a delete-modify conflict it would check out "theirs". Moreover, previous code would write the merge result to the link target, not to the link. This would overwrite an existing link target, or fail if the link pointed to a directory. In link/file conflicts or file/link conflicts, C git always puts the file into the working tree. Change conflict handling accordingly. Add tests for all the conflict cases. Bug: 580347 Change-Id: I3cffcb4bcf8e336a85186031fff23f0c4b6ee19d Signed-off-by: Thomas Wolf <twolf@apache.org>
| * | | | | | Revert "Adds FilteredRevCommit that can overwrites its parents in theMatthias Sohn2022-09-065-381/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DAG." This reverts commit 6297491e8adb85e43d60ffe75fb71f335e733449. This is done as a quick fix for the failure of egit tests caused by the introduction of FilteredRevCommit. Bug: 580690 Change-Id: Ia6b651dd11b0a4b02d5e52247eb4bf13adf94e27
| * | | | | | Revert "Option to pass start RevCommit to be blamed on to theMatthias Sohn2022-09-061-303/+26
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BlameGenerator." This reverts commit 5747bba48b22a11beba8ebe0caf13a53d4ca96f2. This is done as a quick fix for the failure of egit tests caused by the introduction of FilteredRevCommit. Bug: 580690 Change-Id: Ia0178bc2de4fc825a81207bbd7979bf3a386c955
* / / / / / DfsBundleWriter: Add test case about GC_REST pack.yunjieli2022-09-071-1/+28
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a test case to make sure that the bundle writer writes objects in GC_REST packs as well. Signed-off-by: Yunjie Li <yunjieli@google.com> Change-Id: Iba4d88c573aa1cda4505afbe2b83581a09a343df
* | | | | BaseSuperprojectWriter: report invalid paths as manifest errorsIvan Frade2022-08-231-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An invalid path in the manifest (e.g. '.') is reported by DirCache in a runtime exception. In server context this becomes a 500 instead of a user error. Wrap the runtime invalid path exception into a checked ManifestErrorException that caller can handle. Change-Id: I61a2104922765506ae232334891057bb06141d97
* | | | | ApplyCommand: fix ApplyResult#updatedFilesHan-Wen Nienhuys2022-08-231-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On executing a copy, mark the destination as updated. On executing a rename, mark both source and destination as updated. Change-Id: Ied5b9b0e5a14eac59a06cdd0961e25e143f50ff0
* | | | | Option to pass start RevCommit to be blamed on to the BlameGenerator.Ronald Bhuleskar2022-08-171-26/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can allow passing a FilteredRevCommit which is the filtered list of commit graph making it easier for Blame to work on. This can significantly improve blame performance since blame can skip expensive RevWalk. Change-Id: Ie127cb710d004079e9f53a5802130afdb49a7de1
* | | | | Adds FilteredRevCommit that can overwrites its parents in the DAG.Ronald Bhuleskar2022-08-165-45/+381
| | | | | | | | | | | | | | | | | | | | Change-Id: I1ea63a3b56074099688fc45d6a22943a8ae3c2ae
* | | | | DirCacheCheckout: load WorkingTreeOptions only onceThomas Wolf2022-08-141-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous code loaded the WorkingTreeOptions afresh for every single file being checked out. This checked the git config (all three files, repo, user and system config) for having been modified every time. These checks can be costly, for instance on Windows, or if one of the three config files is not on a local disk, or on an otherwise slow storage. Improve this by loading the options and thus checking the git config only once before the checkout. Bug: 579715 Change-Id: I21cd5a808f9d90b5ca2d022f91f0eeb8ca26091c Signed-off-by: Thomas Wolf <twolf@apache.org>
* | | | | Fix adding symlinks to the index when core.symlinks=falseThomas Wolf2022-08-131-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With core.symlinks=false, symlinks are checked out as plain files. When such a file is re-added to the index, and the index already contains a symlink there, add the file as a symlink. Previous code changed the index entry to a regular file. Bug: 580412 Change-Id: I5497bedc3da89c8b10120b8077c56bc5b67cb791 Signed-off-by: Thomas Wolf <twolf@apache.org>
* | | | | ResolveMerger: add coverage for inCore file => directory transitionHan-Wen Nienhuys2022-08-081-0/+33
| | | | | | | | | | | | | | | | | | | | Change-Id: I6c3473932eb418a036f5943c78e619184559ef3a
* | | | | Merge "Revert "Option to pass start RevCommit to be blamed on to the ↵Terry Parker2022-08-031-303/+26
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | BlameGenerator.""
| * | | | | Revert "Option to pass start RevCommit to be blamed on to the BlameGenerator."Ronald Bhuleskar2022-08-031-303/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 59e8bec6e7705a89b5d0b9c6ac004b323ffa16b0. Reason for revert: The change in https://git.eclipse.org/r/c/jgit/jgit/+/194354 broke the egit test [1]. Calling c.getShortMessage() causes an NPE. [1] https://ci.eclipse.org/egit/job/egit.gerrit/2711/ Change-Id: Iaf5feb35f4bb4c3487b04be15d1fe11376975523
* | | | | | Merge "Revert "Adds FilteredRevCommit that can overwrites its parents in the ↵Terry Parker2022-08-035-280/+18
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | DAG.""
| * | | | | | Revert "Adds FilteredRevCommit that can overwrites its parents in the DAG."Ronald Bhuleskar2022-08-035-280/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ceb51a5e0e9db166e572ea7cd362795b4662b0cd. Reason for revert: The change in https://git.eclipse.org/r/c/jgit/jgit/+/194354 broke the egit test [1]. Calling c.getShortMessage() causes an NPE. [1] https://ci.eclipse.org/egit/job/egit.gerrit/2711/ Change-Id: I411565b6eaa0bbb562cc1c8a355942ff09fd29bc
* | | | | | | CleanCommand: fix prefix matchingThomas Wolf2022-08-032-0/+40
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | String.startsWith() is not a valid test for file path prefixes: directory "a" is _not_ a prefix of a file "ab", only of "a/b". Add a proper Paths.isEqualOrPrefix() method and use it in CleanCommand. Bug: 580478 Change-Id: I6863e6ba94a8ffba6561835cc57044a0945d2770 Signed-off-by: Thomas Wolf <twolf@apache.org>
* | | | | | Option to pass start RevCommit to be blamed on to the BlameGenerator.Ronald Bhuleskar2022-08-021-26/+303
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can allow passing a FilteredRevCommit which is the filtered list of commit graph making it easier for Blame to work on. This can significantly improve blame performance since blame can skip expensive RevWalk. Change-Id: I5dab25301d6aef7df6a0bc25a4c553c730199272
* | | | | Adds FilteredRevCommit that can overwrites its parents in the DAG.Ronald Bhuleskar2022-08-025-18/+280
| | | | | | | | | | | | | | | | | | | | Change-Id: I2df9843dde0f589f5fea6cedaaff52e313eea6de
* | | | | Add the ability to override parents on RevCommit.Ronald Bhuleskar2022-08-023-50/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes RevCommit extensible to allow having different structure of child-parent relationship. This change is a pre-requsite for having a FilteredRevCommit that overrides parents from the RevCommit. That then provides a cheaper way to walk over a subset of RevCommits instead of an expensive way that applies filters while walking over selected commits. Useful with Blame which works on a single file and that can be made performant, if we know all the commits needed by the Blame algorithm. So Blame algorithm can avoid walking over finding what commits to blame on. This change makes parents field on RevCommit private and exposes it thrrough overrideable methods such as getParents, getParent at index, getParentCount and setParents. All other files other than RevCommit are updating the usages of accessing RevCommits parents. Change-Id: I2d13b001c599cc4ebc92d1ab6e07b07acb3b7fe5
* | | | | Fix BUILD rules for FilteredRenameDetectorTestDmitrii Filippov2022-08-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The FilteredRenameDetectorTest was added in [1], but bazel build rules were not updated. [1] https://git.eclipse.org/r/c/jgit/jgit/+/194200 Change-Id: I7fc713e19b4768176eb84e9768137431b33a805e
* | | | | Merge "NameConflictTreeWalk: respect git order on multi-tree iteration"Han-Wen NIenhuys2022-08-011-2/+68
|\ \ \ \ \
| * | | | | NameConflictTreeWalk: respect git order on multi-tree iterationDmitrii Filippov2022-07-291-2/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The NameConflictTreeWalk class is used in 3-way merge for iterating over entries in 3 different commits. The class provides information about a current entry and a state of the entry in commits (e.g entry is file, entry is directory, entry is missing). In rare cases, the tree walker can mix information about entries with different name. The problem appears, because git uses unusual sorting order for files. Example (this is a simplified real-life example): Commit 1: * gradle.properties - file * gradle - directory (with nested files) * gradle/file - file in gradle directory Commit 2: * gradle.properties - file * no entry with the name gradle Commit 3: * gradle.properties - file * gradle - file Here the names are ordered like this: "gradle" file <"gradle.properties" file < "gradle/file" file. NameConflictTreeWalk iterator already have code for processing git sorting order, however in the example above the code doesn't work correctly. Before the fix, NameConflictTreeWalk returns: #next() "gradle - directory" | "gradle.properties" | "gradle - file" - which is wrong. The expected result is #next() "gradle - directory | MISSED_FILE | "gradle - file" #next() "gradle.properties"|"gradle.properties"|"gradle.properties" Ensure that the "matches" field of tree iterators (which contains the current path) is kept in sync in the case above. Change-Id: Ief5aa06d80b358f4080043c8694aa0fd7c60045b Signed-off-by: Dmitrii Filippov <dmfilippov@google.com>