aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
Commit message (Collapse)AuthorAgeFilesLines
* LockFile: Retry lock creation if parent dirs were removedKaushik Lingarkar2024-08-211-2/+15
| | | | | | | | | | In the small window between creation of the lock file's parent dirs and the lock file itself, the parent dirs may be cleaned by an external process packing refs in the repository. When this scenario occurs, retry creating the lock file (along with its parent dirs). Change-Id: Id7ec60c3f7f373b59f1dc8de6b8fa6df6bdf2570 Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
* Merge branch 'stable-6.9' into stable-6.10Matthias Sohn2024-08-201-1/+1
|\ | | | | | | | | | | | | | | | | | | * stable-6.9: Update tycho to 4.0.8 Update org.eclipse.dash:license-tool-plugin to 1.1.0 Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: I68e73b6e0c6cda003bc18b3e82266c1d8a1f183e
| * Merge branch 'stable-6.8' into stable-6.9Matthias Sohn2024-08-201-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.8: Update tycho to 4.0.8 Update org.eclipse.dash:license-tool-plugin to 1.1.0 Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: I29478165b8304316713ffd6a4c6d669dd5760c88
| | * Merge branch 'stable-6.7' into stable-6.8Matthias Sohn2024-08-201-1/+1
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.7: Update tycho to 4.0.8 Update org.eclipse.dash:license-tool-plugin to 1.1.0 Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: I513a1cbb2bfd002d125b04f7944a625ca52decea
| | | * Merge branch 'stable-6.6' into stable-6.7Matthias Sohn2024-08-201-1/+1
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.6: Update tycho to 4.0.8 Update org.eclipse.dash:license-tool-plugin to 1.1.0 Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: I79bb467325e5c09d93e0220be8233ba0d91562cb
| | | | * Merge branch 'stable-6.5' into stable-6.6Matthias Sohn2024-08-201-1/+1
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.5: Update org.eclipse.dash:license-tool-plugin to 1.1.0 Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: I54d1776b3ea096d458b8005e70c02e7edef71c2b
| | | | | * Merge branch 'stable-6.4' into stable-6.5stable-6.5Matthias Sohn2024-08-181-1/+1
| | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.4: Update org.eclipse.dash:license-tool-plugin to 1.1.0 Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: Ieae366586ac4c449a4f9454dc4b63513e7573776
| | | | | | * Merge branch 'stable-6.3' into stable-6.4stable-6.4Matthias Sohn2024-08-181-1/+1
| | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: Ia9eefc4004ca01d97ff0c4dae9a6220d48e76b88
| | | | | | | * Merge branch 'stable-6.2' into stable-6.3stable-6.3Matthias Sohn2024-08-141-1/+1
| | | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.2: Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: I6bce3a4d64a617d74d0cbf4e79887b067e1ea2c5
| | | | | | | | * Merge branch 'stable-6.1' into stable-6.2stable-6.2Matthias Sohn2024-08-141-1/+1
| | | | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: Ib536297ef20a75b36cff8f41d57855913f7d7f26
| | | | | | | | | * Merge branch 'stable-6.0' into stable-6.1stable-6.1Matthias Sohn2024-08-141-1/+1
| | | | | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: I23afe07585ff17ad8486cbe2c667f6acbe912542
| | | | | | | | | | * Merge branch 'stable-5.13' into stable-6.0stable-6.0Matthias Sohn2024-08-141-1/+1
| | | | | | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: Ib15aa83972d81986959889dc03e943fe55c78873
| | | | | | | | | | | * Fix "Comparison of narrow type with wide type in loop condition"stable-5.13Matthias Sohn2024-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This issue was detected by a GitHub CodeQL security scan run on JGit source code. Description of the error raised by the security scan: "In a loop condition, comparison of a value of a narrow type with a value of a wide type may always evaluate to true if the wider value is sufficiently large (or small). This is because the narrower value may overflow. This can lead to an infinite loop." Fix this by using type `long` for the local variable `done`. Change-Id: Ibd4f71299e3f2e40d4331227bd143569a4264d8c
| | | | | | | | | | | * JGit v5.13.3.202401111512-rv5.13.3.202401111512-rMatthias Sohn2024-01-113-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: Iacf106ce4013e9e12876e85ae341022a44bccb5c
| | | | | | | | | | | * Checkout: better directory handlingThomas Wolf2023-10-229-141/+674
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This backports the upstream security fix to downstream stable-5.13 branch. (cherry picked from commit 9072103f3b3cf64dd12ad2949836ab98f62dabf1) When checking out a file into the working tree ensure that all parent directories of the file below the working tree root are actually directories and do exist before we try to create the file. When multiple files are to be checked out (or even a whole tree), this may check the same directories over and over again. Asking the file system every time for file attributes is a potentially expensive operation. As a remedy, introduce an in-memory cache of directory states for a particular check-out operation. Apply the same fix also in the ResolveMerger, which may also check out files, and also in the PatchApplier. In PatchApplier, also validate paths. Change-Id: Ie12864c54c9f901a2ccee7caddec73027f353111 Signed-off-by: Thomas Wolf <twolf@apache.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | | | | | RepoProject: read the 'dest-branch' attribute of a projectKaushik Lingarkar2024-07-083-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The manifest spec [1] defines a "dest-branch" attribute. Parse its value and store it in the RepoProject. Also, create a getter/setter for dest-branch. [1] https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.md#Element-project Change-Id: I8ad83b0fec59d2b0967864e4de4fefde4ab971ff (cherry picked from commit 47fd412affd8d7578606ae9b3015a911b71b13ed)
* | | | | | | | | | | | Make RepoProject#setUpstream publicKaushik Lingarkar2024-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applications using JGit such as Gerrit plugins may have their own manifest parsers. They can start using RepoProject to some extent with this change. Eventually, they can be migrated to use the ManifestParser in JGit, however until then, this change can help make the migration incremental. Change-Id: I6a32d4f4622c3842eedf7873cdfed2f1ca998f6f (cherry picked from commit e3e0a1ea35a27e50e0280715a417be7d69fa3345)
* | | | | | | | | | | | RepoCommand: Add error to ManifestErrorExceptionIvan Frade2024-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RepoCommand wraps errors in the manifest in a ManifestErrorException with a fixed message ("Invalid manifest"). Callers like supermanifest plugin cannot return a meaningful error to the client without digging into the cause chain. Add the actual error message to the ManifestErrorException, so callers can rely on #getMessage() to see what happens. Change-Id: I18be17fb5e4aaaf4f11ebd627580a91fe330eaca (cherry picked from commit b41187429359cf9830fd34368d28a454653e187d)
* | | | | | | | | | | | RepoCommand: Copy manifest upstream into .gitmodules ref fieldIvan Frade2024-07-082-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Project entries in the manifest with a specific sha1 as revision can use the "upstream" field to report the ref pointing to that sha1. This information is very valuable for downstream tools, as they can limit their search for a blob to the relevant ref, but it gets lost in the translation to .gitmodules. Save the value of the upstream field when available/relevant in the ref field of the .gitmodules entry. Change-Id: I14a2395925618d5e6b34be85466e32f5ef8fbf6e (cherry picked from commit 48465f84014904edddcdd48258c67bc19555d4c3)
* | | | | | | | | | | | RepoProject: read the "upstream" attribute of a projectIvan Frade2024-07-082-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The manifest spec [1] defines the "upstream" attribute: "name of the git ref in which a sha1 can be found", when the revision is a sha1. The parser is ignoring it, but RepoCommand could use it to populate the "ref=" field of pinned submodules. Parse the value and store it in the RepoProject. RepoProject is public API and the current constructors are not telescopic, so we cannot just add a new constructor with an extra argument. Use plain getter/setters.j [1] https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.md#Element-project Change-Id: Ia50b85b95bfd3710f9fbda2050be5950dd686941 (cherry picked from commit 1dd6324d4b4d9596813b18a44e315295f559ea12)
* | | | | | | | | | | | Prepare 6.10.1-SNAPSHOT buildsMatthias Sohn2024-06-043-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I3384e7405cadf063e7b0dd25468a8651c45628ac
* | | | | | | | | | | | JGit v6.10.0.202406032230-rv6.10.0.202406032230-rMatthias Sohn2024-06-043-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: Id188a6cdc2db63c961f0b9338e6ae56d58853dff
* | | | | | | | | | | | JGit v6.10.0.202406032110-rv6.10.0.202406032110-rMatthias Sohn2024-06-033-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: I3128b2e4bbbed97adde90f7a47e15175e63e97f5
* | | | | | | | | | | | Prepare 6.10.0-SNAPSHOT buildsMatthias Sohn2024-06-023-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I64f6d6a0599cbab462dca236c00e6f3314b2a810
* | | | | | | | | | | | JGit v6.10.0.202405290101-rc1v6.10.0.202405290101-rc1Matthias Sohn2024-05-293-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: Ie3d08213e00fcfe1fc34a39021dd99f27e0abc1f
* | | | | | | | | | | | JGit v6.10.0.202405282244-rc1v6.10.0.202405282244-rc1Matthias Sohn2024-05-293-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: Ia525790e0b4c9011b29768d2b9727cb48b21ba84
* | | | | | | | | | | | PatchApplier.Result.Error: mark fields finalMatthias Sohn2024-05-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fields of an Error instance shouldn't be modifiable after its creation. Adapt tests which were setting hh to null to skip asserting it. Change-Id: I0f55c1d5cd529aa510029054e6f05bd2637d1bca
* | | | | | | | | | | | PatchApplier: Set a boolean on the result if conflict markers were addedPatrick Hiesel2024-05-271-6/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will let callers show a different error message or mark the state as conflicting. Change-Id: Id8eea614b6b8d54c62b49ffbac90599e6f4c5efa
* | | | | | | | | | | | Remove version override of commons-codecThomas Wolf2024-05-252-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 8164155b the commons-codec version is pinned in the parent POM's dependency management. Remove the version specification in org.eclipse.jgit/pom.xml. Also give the package-import in the MANIFEST.MF an upper bound. Change-Id: I2785a87cf77d6df110f57a0cb939dbc9772b8ee6 Signed-off-by: Thomas Wolf <twolf@apache.org>
* | | | | | | | | | | | WalkFetchConnection: Remove marked packs on all function exitsIvan Frade2024-05-161-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [1] replaces Iterator.remove() with a list of "toRemove" that gets processed when returning at the end. There are two others returns in the function where the list is not processed. Let the method report the broken packages and wrap it so the caller can clean them up in any case. [1] https://review.gerrithub.io/c/eclipse-jgit/jgit/+/1194812 Change-Id: I1ffb7829039f644df03b0b3ea1e5d10408ce19b7
* | | | | | | | | | | | Merge "Do not use ArrayList when there will be deletions"Ivan Frade2024-05-163-27/+30
|\ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | Do not use ArrayList when there will be deletionsjackdt@google.com2024-05-163-27/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In https://gerrithub.io/c/eclipse-jgit/jgit/+/1194015, LinkedList was replaced with ArrayList in DfsReader and WalkFetchConnection. In this case, the Iterator.remove() method of List is called, which is an O(n) operation for ArrayList. This results in an O(n^2) algorithm. Instead of reverting to LinkedList, use a HashSet and LinkedHashmap instead. This maintains O(1) removal, and is less likely to be treated as an antipattern than LinkedList. A likely innocuous usage of Iterator.remove() in UnionInputStream was also fixed. Change-Id: I57d884440c726b2fc80c1b8b2bec9bd7e2e6e3fe
* | | | | | | | | | | | | Merge changes I12e4d0fd,I082ffb20Matthias Sohn2024-05-161-19/+0
|\ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: Remove unused API problem filters Fix warning "Redundant specification of type arguments <Object>"
| * | | | | | | | | | | | Remove unused API problem filtersMatthias Sohn2024-05-141-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I12e4d0fd48b5b7420d421874c8d63caed9628266
* | | | | | | | | | | | | Merge "Allow applying a patch with conflicts"Matthias Sohn2024-05-151-19/+115
|\ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / |/| | | | | | | | | | | |
| * | | | | | | | | | | | Allow applying a patch with conflictsPatrick Hiesel2024-05-141-19/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some settings, we want to let users apply a patch that does not cleanly apply and add conflict markers. In Gerrit, this is useful when cherry picking (via Git patches) from one host to another. This commit takes a simple approach: If a hunk doesn't apply, go to the pre-image line, treat all lines in pre-image length as left side of the conflict and all context and newly added lines as right side of the conflict. Change-Id: I01411d7a32b3f3207097b26231909aae6b835650
* | | | | | | | | | | | | Check an execution bit by reading it from the file systemYury Molchan2024-05-131-2/+11
|/ / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Files.isExecutable() checks possibility to execute a file from the JVM, not POSIX attributes. So it fails when Java Security Manager does not allow to execute a file, but file has X-bit. Change-Id: I85b96fb6cedbaff1b3c063728c25b6ce4d04e9b9
* | | | | | | | | | | | PackIndex: Make it an interfaceIvan Frade2024-05-083-23/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we work on different backends for PackIndex, it is much easier to extend an interface than an abstract class. Note that PackIndex is alredy acting as an interface, offering barely any functionality. Change-Id: Icd0db0e96a097631c2b9c3b05e5700f601f606d5
* | | | | | | | | | | | PackIndex: Make iterator static (pass object count in ctor)Ivan Frade2024-05-083-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The iterator uses an implicit reference to the external class to call #getObjectCount(). This implicit reference prevents PackIndex to become an interface. The object count is immutable and known at index (and iterator) construction time. Pass the object count in the constructor of the iterator and make it static. Change-Id: I4949ff943de2a88380fb7f4c9b65b089734854b9
* | | | | | | | | | | | PackIndex: move checksum to the subclassesIvan Frade2024-05-084-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PackIndex is almost an interface, and making it so simplifies writing implementations over other storages. Checksum and its getter is the only functionality that is class specific. Make getChecksum abstract and implement it in the subclasses. Change-Id: I3746515d816abab075210505f1bb31b1936962e9
* | | | | | | | | | | | Merge "PackIndex: Make #getOffset protected to allow out-of-package subclasses"Ivan Frade2024-05-012-2/+2
|\ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | PackIndex: Make #getOffset protected to allow out-of-package subclassesIvan Frade2024-04-262-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PackIndex#getOffset is abstract and package-private, limiting subclasses to the same package. Given than the class and all other relevant methods are public, this looks like an oversight and it should be ok to write subclasses in other packages. Make the method protected, allowing to write PackIndex subclasses in other packages. Change-Id: I7d3762b0a6c0681c29bd827bbaf094f1ee4583d2
* | | | | | | | | | | | | [errorprone] Fix error pattern JdkObsoleteMatthias Sohn2024-04-2927-82/+77
|/ / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://errorprone.info/bugpattern/JdkObsolete Change-Id: Id105e2695eb64523bd217f507bf95f909bc6b348
* | | | | | | | | | | | ResolveMerger: Fix the issue with binary modify-modify conflictsSruteesh2024-04-251-30/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) If the file was marked as binary by git attributes, we should add the path to conflicts if content differs in OURS and THEIRS 2) If the path is a file in OURS, THEIRS and BASE and if it is a binary in any one of them, no content merge should be attempted and the file content is kept as is in the work tree Bug: jgit-14 Change-Id: I9201bdc53a55f8f40adade4b6a36ee8ae25f4db8
* | | | | | | | | | | | PackBitmapIndexBuilder.StoredEntry: add getter for objectIdSam Delmerico2024-04-121-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you only have access to the PackBitmapIndexBuilder there is no way to get the ObjectId from a StoredEntry instance without also having access to a reverse pack index. The StoredEntry can provide the idxPosition, but the PackBitmapIndexBuilder's getObject method requires a ridxPosition in order to find an ObjectId. Providing an ObjectId from the StoredEntry gives this information directly and also allows a caller to get the ridxPosition if desired by calling PackBitmapIndexBuilder.findPosition(objectId) without needing an index object. This closes the operations of the PackBitmapIndexBuilder such that any method can be called by using information provided by the other methods. Change-Id: I5a11479b9635cd6b5e7aaff2f862cd41069ac469
* | | | | | | | | | | | PackBitmapIndex: clarify naming of getObject inputsSam Delmerico2024-04-123-19/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation for the getObject function seems to be a little outdated. This commit clarifies that this function accepts an offset based on the ordering of objects in the pack. Change-Id: Icffaf4fb72155c415f5fd248e721cab87a1a083e
* | | | | | | | | | | | Merge "MergeAlgorithm: Fix diff3 conflict hunk computation"Ivan Frade2024-04-091-2/+11
|\ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | MergeAlgorithm: Fix diff3 conflict hunk computationAntonin Delpeuch2024-04-091-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes https://github.com/eclipse-jgit/jgit/issues/38. The previous code computed the boundaries of the base part of conflict hunks using line numbers computed for the 'ours' and 'theirs' revisions, leading to incorrect boundaries. This only affects the presentation of merge conflicts in diff3 mode (which is probably not used a lot yet on Gerrit). Successful merges are unaffected. Change-Id: I173c79bf5797896dc854791d6d05cb3f035726f4 Signed-off-by: Antonin Delpeuch <antonin@delpeuch.eu>
* | | | | | | | | | | | | PackBitmapIndexBuilder: make StoredEntry constructor publicSam Delmerico2024-04-031-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This POD data structure can be used externally Change-Id: I464c45b93d0a56deaadbfe31df57a87e1054741c
* | | | | | | | | | | | | Merge "PackBitmapIndexBuilder: allow repeated call of getCompressedBitmaps()"Ivan Frade2024-04-021-2/+3
|\ \ \ \ \ \ \ \ \ \ \ \ \