]> source.dussan.org Git - jgit.git/log
jgit.git
6 months agoUpdate args4j to 2.37 14/1194614/2
Matthias Sohn [Sun, 12 May 2024 22:56:20 +0000 (00:56 +0200)]
Update args4j to 2.37

Change-Id: I6f8c1cce050017aad5b0d36886f85c42c1a3aed9

6 months agoCheck an execution bit by reading it from the file system 28/1193828/4
Yury Molchan [Wed, 6 Dec 2023 02:29:39 +0000 (04:29 +0200)]
Check an execution bit by reading it from the file system

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

6 months ago[releng] Bump Bouncy Castle to 1.78.1 95/1194595/1
Thomas Wolf [Sat, 11 May 2024 12:11:17 +0000 (14:11 +0200)]
[releng] Bump Bouncy Castle to 1.78.1

Update version in pom.xml; update target platforms; update bazel
workspace.

BC 1.78 had broken OSGi metadata in MANIFEST.MF; this was fixed in
1.78.1.

Change-Id: Iac5751910b283b04983abe399264e0dabfe6162c
Signed-off-by: Thomas Wolf <twolf@apache.org>
6 months agoPackIndex: Make it an interface 74/1194474/3
Ivan Frade [Thu, 28 Mar 2024 22:11:05 +0000 (15:11 -0700)]
PackIndex: Make it an interface

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

6 months agoPackIndex: Make iterator static (pass object count in ctor) 73/1194473/2
Ivan Frade [Thu, 28 Mar 2024 22:07:34 +0000 (15:07 -0700)]
PackIndex: Make iterator static (pass object count in ctor)

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

6 months agoPackIndex: move checksum to the subclasses 72/1194472/2
Ivan Frade [Thu, 28 Mar 2024 21:55:09 +0000 (14:55 -0700)]
PackIndex: move checksum to the subclasses

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

6 months agoGitDateFormatterTest: Remove printlns 01/1194201/1
Ivan Frade [Thu, 2 May 2024 16:43:12 +0000 (09:43 -0700)]
GitDateFormatterTest: Remove printlns

Left overs from https://review.gerrithub.io/c/eclipse-jgit/jgit/+/204984

Change-Id: I169ce2a008ca70267323fa4fb0f1e54981f1ec33

6 months agoBazel: Add support for JDK 21 84/204984/10
David Ostrovsky [Tue, 17 Oct 2023 07:47:35 +0000 (09:47 +0200)]
Bazel: Add support for JDK 21

There are two failing tests when switching to JDK 21.

One failure is related to the changed behaviour related to the locale
providers. Adapt `GitDateFormatterTest` to changes in unicode [1].

Second failure related to changed behaviour in URL.openConnection(),
see: [2] for more details.

Before JDK 20, some of the parsing/validation performed by the JDK
built-in URLStreamHander implementations were delayed until
URL::openConnection or URLConnection::connect was called. Starting
JDK 20, some of these parsing/validations are now performed early,
i.e. within URL constructors.

IOW, the assumption made in HttpSupport.TesttestMalformedUri() isn't
met any more: providing mailformed URI to the URL ctor now throws an
exception starting with JDK 20. To rectify the problem, remove the
offending test.

Test plan:

To build with JDK 21 and run the tests locally:

  $> bazel test --config=java21 //...

To build with JDK 21 and run the tests on RBE:

  $> bazel test --config=remote21 --remote_instance_name=$PROJECT //...

[1] https://bugs.openjdk.org/browse/JDK-8304925
[2] https://bugs.openjdk.org/browse/JDK-8293590

Change-Id: I796de67f7945d5f1fa5e8146f4ec8cbe9ac7bd3e

6 months agoMerge "Bazel: Replace deprecated --experimental_strict_action_env option"
David Ostrovsky [Thu, 2 May 2024 12:52:47 +0000 (12:52 +0000)]
Merge "Bazel: Replace deprecated --experimental_strict_action_env option"

6 months agoMerge "PackIndex: Make #getOffset protected to allow out-of-package subclasses"
Ivan Frade [Wed, 1 May 2024 16:21:32 +0000 (16:21 +0000)]
Merge "PackIndex: Make #getOffset protected to allow out-of-package subclasses"

6 months agoBazel: Replace deprecated --experimental_strict_action_env option 69/1194069/1
David Ostrovsky [Tue, 30 Apr 2024 05:07:20 +0000 (07:07 +0200)]
Bazel: Replace deprecated --experimental_strict_action_env option

In recent Bazel release the option was deprecated and replaced with:
--incompatible_strict_action_env option.

Hence this change is fixing this warning:

  WARNING: Option 'experimental_strict_action_env' is deprecated:
  Use --incompatible_strict_action_env instead

Change-Id: I49645b084c338d9c2bfff8ad20831bcf18de6b53

6 months agoFix warning about using raw type 25/1194025/1
Matthias Sohn [Mon, 29 Apr 2024 13:24:02 +0000 (15:24 +0200)]
Fix warning about using raw type

This fixes the warning in UploadPackHandleDeletedPackFileTest. line 116:

"Type safety: The method register(Object, Repository) belongs to the raw
type TestProtocol. References to generic type TestProtocol<C> should be
parameterized."

Change-Id: I5a74269f1af7369dd397dd0f1c3cd807c0351367

6 months ago[errorprone] Fix pattern ModifiedButNotUsed 24/1194024/3
Matthias Sohn [Mon, 29 Apr 2024 00:16:23 +0000 (02:16 +0200)]
[errorprone] Fix pattern ModifiedButNotUsed

See https://errorprone.info/bugpattern/ModifiedButNotUsed

Change-Id: I3bd3f865d50a26af6c594391de5adf35230c984f

6 months ago[errorprone] Fix pattern CatchAndPrintStackTrace 23/1194023/3
Matthias Sohn [Sun, 28 Apr 2024 23:54:01 +0000 (01:54 +0200)]
[errorprone] Fix pattern CatchAndPrintStackTrace

See https://errorprone.info/bugpattern/CatchAndPrintStackTrace

Change-Id: I7a6698293d1485f384c275bf7e4dcddc529af4a1

6 months ago[errorprone] Fix pattern FutureReturnValueIgnored 22/1194022/3
Matthias Sohn [Sun, 28 Apr 2024 23:37:28 +0000 (01:37 +0200)]
[errorprone] Fix pattern FutureReturnValueIgnored

See https://errorprone.info/bugpattern/FutureReturnValueIgnored

Change-Id: I7225fd6388ce70ed5eea9e61b29bd10e1a927acb

6 months ago[errorprone] Fix pattern BadImport 21/1194021/3
Matthias Sohn [Sun, 28 Apr 2024 23:11:16 +0000 (01:11 +0200)]
[errorprone] Fix pattern BadImport

See https://errorprone.info/bugpattern/BadImport

Change-Id: I24e5a7a4a64d8b3cf2cc3d394090ce90e849f9f9

6 months ago[errorprone] Fix pattern UseCorrectAssertInTests 20/1194020/3
Matthias Sohn [Sun, 28 Apr 2024 22:55:54 +0000 (00:55 +0200)]
[errorprone] Fix pattern UseCorrectAssertInTests

See https://errorprone.info/bugpattern/UseCorrectAssertInTests

Change-Id: Iffde63ac795ad30c3e7774764cb8189cb089ed86

6 months ago[errorprone] Fix pattern ProtectedMembersInFinalClass 19/1194019/3
Matthias Sohn [Sun, 28 Apr 2024 22:42:46 +0000 (00:42 +0200)]
[errorprone] Fix pattern ProtectedMembersInFinalClass

See https://errorprone.info/bugpattern/ProtectedMembersInFinalClass

Change-Id: I5993093ca012f091dfe8ee1f2099b9596c2ee697

6 months ago[errorprone] Fix pattern CatchFail 18/1194018/3
Matthias Sohn [Sun, 28 Apr 2024 22:29:30 +0000 (00:29 +0200)]
[errorprone] Fix pattern CatchFail

See https://errorprone.info/bugpattern/CatchFail

Change-Id: If1c637a420c4e669a5bdbe4abcefc5c3a2b3a43b

6 months ago[errorprone] Fix pattern see UnusedVariable 17/1194017/2
Matthias Sohn [Sun, 28 Apr 2024 22:11:46 +0000 (00:11 +0200)]
[errorprone] Fix pattern see UnusedVariable

See https://errorprone.info/bugpattern/UnusedVariable

Change-Id: I75d7602af31ed7d3264d2beab2d159cfbf29e7cb

6 months ago[errorprone] Fix pattern LongLiteralLowerCaseSuffix 16/1194016/2
Matthias Sohn [Sun, 28 Apr 2024 20:46:09 +0000 (22:46 +0200)]
[errorprone] Fix pattern LongLiteralLowerCaseSuffix

See https://errorprone.info/bugpattern/LongLiteralLowerCaseSuffix

Change-Id: I139eadef5d66dfed2952ba9e1c91b3fe83259e97

6 months ago[errorprone] Fix error pattern JdkObsolete 15/1194015/2
Matthias Sohn [Sun, 28 Apr 2024 20:41:46 +0000 (22:41 +0200)]
[errorprone] Fix error pattern JdkObsolete

See https://errorprone.info/bugpattern/JdkObsolete

Change-Id: Id105e2695eb64523bd217f507bf95f909bc6b348

6 months ago[errorprone] Fix UnnecessaryParentheses errors 14/1194014/1
Matthias Sohn [Sun, 28 Apr 2024 19:28:30 +0000 (21:28 +0200)]
[errorprone] Fix UnnecessaryParentheses errors

See https://errorprone.info/bugpattern/UnnecessaryParentheses

Change-Id: I783fd24286ec1bd55efbf21d05758465f4af87ee

6 months agoBazel: Update RBE docker image to Ubuntu 22.04 and JDK 17 70/1193970/2
David Ostrovsky [Sun, 28 Apr 2024 12:30:56 +0000 (14:30 +0200)]
Bazel: Update RBE docker image to Ubuntu 22.04 and JDK 17

In this change we update the JDK used in RBE to JDK 17.

Use Ubuntu 22.04 docker image with JDK 17 from Bazel project as the new
base image. So that we don't need to maintain our own docker image any
more.

Also align the naming convention for the docker images with the Bazel
project: <OS version>-<JDK version>, and remove "rbe"-prefix from the
docker image name, because the image doesn't have any RBE specifics and
could be used for Gerrit build and tests outside of the RBE pipeline.

Change-Id: I617354c79301ec6dd52161dd3727f646c2a8ac56

6 months agoBump Bazel version to 7.1.1 80/204980/7
David Ostrovsky [Sun, 28 Apr 2024 17:17:41 +0000 (19:17 +0200)]
Bump Bazel version to 7.1.1

In Bazel 7.x release line, the bzlmod feature is activated per default,
so that we need to disable it. See this issue for more details: [1].

Test plan:

  $> bazel test //...

[1] https://github.com/bazelbuild/bazel/issues/18958

Change-Id: I2526d93020c5d82314a09206907ebeed6f1a1700

6 months agoPackIndex: Make #getOffset protected to allow out-of-package subclasses 61/1193961/1
Ivan Frade [Fri, 26 Apr 2024 21:04:08 +0000 (14:04 -0700)]
PackIndex: Make #getOffset protected to allow out-of-package subclasses

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

6 months agoResolveMerger: Fix the issue with binary modify-modify conflicts 33/1176833/5
Sruteesh [Wed, 14 Feb 2024 16:49:39 +0000 (22:19 +0530)]
ResolveMerger: Fix the issue with binary modify-modify conflicts

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

7 months agoExplain why RacyGitTests may be flaky in some environments 34/1193534/1
Matthias Sohn [Sat, 20 Apr 2024 18:28:20 +0000 (20:28 +0200)]
Explain why RacyGitTests may be flaky in some environments

Change-Id: I5bbd04754f5f29299a7b9a58a3717e3f615199d0

7 months agoMerge "PackBitmapIndexBuilder.StoredEntry: add getter for objectId"
Ivan Frade [Fri, 12 Apr 2024 16:05:14 +0000 (16:05 +0000)]
Merge "PackBitmapIndexBuilder.StoredEntry: add getter for objectId"

7 months agoMerge "PackBitmapIndex: clarify naming of getObject inputs"
Ivan Frade [Fri, 12 Apr 2024 16:03:58 +0000 (16:03 +0000)]
Merge "PackBitmapIndex: clarify naming of getObject inputs"

7 months agoPackBitmapIndexBuilder.StoredEntry: add getter for objectId 41/1192941/11
Sam Delmerico [Wed, 10 Apr 2024 18:03:46 +0000 (11:03 -0700)]
PackBitmapIndexBuilder.StoredEntry: add getter for objectId

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

7 months agoPackBitmapIndex: clarify naming of getObject inputs 08/1192808/11
Sam Delmerico [Tue, 9 Apr 2024 23:56:38 +0000 (16:56 -0700)]
PackBitmapIndex: clarify naming of getObject inputs

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

7 months agoMerge "Add more tests on rewriting parents in a RevWalk"
Ivan Frade [Thu, 11 Apr 2024 21:11:58 +0000 (21:11 +0000)]
Merge "Add more tests on rewriting parents in a RevWalk"

7 months agoRevert "[releng] Bump Bouncy Castle to 1.78" 42/1192942/1
Thomas Wolf [Wed, 10 Apr 2024 18:53:33 +0000 (20:53 +0200)]
Revert "[releng] Bump Bouncy Castle to 1.78"

This reverts commit 718d121bb38860e66f6e34a4045aa6d5d9490e8a.

Bouncy Castle 1.78 has broken OSGi metadata: the package imports in
MANIFEST.MF are missing. See also [1] and [2].

[1] https://github.com/bcgit/bc-java/issues/1621
[2] https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/pull/1968#issuecomment-2048151288

Change-Id: Iedec921215dabe0b63fb0dd7f6a4b28c18f854a0
Signed-off-by: Thomas Wolf <twolf@apache.org>
7 months ago[releng] Bump Bouncy Castle to 1.78 51/1192751/2
Thomas Wolf [Mon, 8 Apr 2024 16:37:32 +0000 (18:37 +0200)]
[releng] Bump Bouncy Castle to 1.78

Update version in pom.xml; update target platforms; update bazel
workspace.

Also update the p2 repository; the Bouncy Castle bundle symbolic names
have changed from plain "bc*" to "bc*-jdk18on".

Change-Id: I07a5709c791f644d2247c76404a36ba7d0625a1c
Signed-off-by: Thomas Wolf <twolf@apache.org>
7 months agoMerge changes Ib7e3e562,I9d1f641c,Ia50445b8
Thomas Wolf [Tue, 9 Apr 2024 18:15:35 +0000 (18:15 +0000)]
Merge changes Ib7e3e562,I9d1f641c,Ia50445b8

* changes:
  [gpg] Remove obsolete import-package
  [gpg] Correct finding public keys from pubring.gpg
  [gpg] Fix reading ed25519 GPG keys

7 months agoMerge "MergeAlgorithm: Fix diff3 conflict hunk computation"
Ivan Frade [Tue, 9 Apr 2024 18:01:37 +0000 (18:01 +0000)]
Merge "MergeAlgorithm: Fix diff3 conflict hunk computation"

7 months agoMergeAlgorithm: Fix diff3 conflict hunk computation 76/1177976/4
Antonin Delpeuch [Sun, 10 Mar 2024 20:19:12 +0000 (21:19 +0100)]
MergeAlgorithm: Fix diff3 conflict hunk computation

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>
7 months ago[gpg] Remove obsolete import-package 50/1192750/1
Thomas Wolf [Mon, 8 Apr 2024 16:31:38 +0000 (18:31 +0200)]
[gpg] Remove obsolete import-package

Bug: jgit-46
Change-Id: Ib7e3e562ca7ef9a30dfb7a1198f729bb389a5208
Signed-off-by: Thomas Wolf <twolf@apache.org>
7 months ago[gpg] Correct finding public keys from pubring.gpg 67/1184467/2
Thomas Wolf [Sat, 9 Mar 2024 23:04:41 +0000 (00:04 +0100)]
[gpg] Correct finding public keys from pubring.gpg

With a master key not enabled for signing, and a signing sub-key, key
lookup went wrong in several ways and might not find a suitable key for
signing or for signature verification. Fix the code so that it finds
the sub-key, even if user.signingKey is specified not with a key ID but
with an with an e-mail. (Sub-keys don't have user ids, those are
attached only on the master key.)

Change-Id: I9d1f641c49b173d4daffb3fd2e74f5aabd856e39
Signed-off-by: Thomas Wolf <twolf@apache.org>
7 months ago[gpg] Fix reading ed25519 GPG keys 66/1184466/2
Thomas Wolf [Sat, 9 Mar 2024 09:18:10 +0000 (10:18 +0100)]
[gpg] Fix reading ed25519 GPG keys

The S-expression parser from Bouncy Castle parsed such keys wrongly;
there is a "flags" sub-list before the "q" value. Additionally, the
parser validates the key read against the given public key, this failed
because Bouncy Castle does not know the OID of curve name "Ed25519".

Fix this and add a test for reading an ed25519 GPG key.

Bug: jgit-27
Change-Id: Ia50445b88759927d2e80b9871d498fbe5ad201bc
Signed-off-by: Thomas Wolf <twolf@apache.org>
7 months agoPackBitmapIndexBuilder: make StoredEntry constructor public 06/1190806/2
Sam Delmerico [Tue, 2 Apr 2024 19:24:02 +0000 (12:24 -0700)]
PackBitmapIndexBuilder: make StoredEntry constructor public

This POD data structure can be used externally

Change-Id: I464c45b93d0a56deaadbfe31df57a87e1054741c

7 months agoMerge "PackBitmapIndexBuilder: allow repeated call of getCompressedBitmaps()"
Ivan Frade [Tue, 2 Apr 2024 20:29:21 +0000 (20:29 +0000)]
Merge "PackBitmapIndexBuilder: allow repeated call of getCompressedBitmaps()"

7 months agoPackBitmapIndexBuilder: allow repeated call of getCompressedBitmaps() 33/1188433/5
Sam Delmerico [Wed, 27 Mar 2024 19:09:42 +0000 (12:09 -0700)]
PackBitmapIndexBuilder: allow repeated call of getCompressedBitmaps()

Each call of the current implementation of
PackBitmapIndexBuilder.getCompressedBitmaps reverses the class member that is returned. So two subsequent calls of this function will
receive reversed structures.

Instead we should just reverse a copy of the structure. This way the
PackBitmapIndexBuilder can continue to efficiently accept new bitmaps
via processBitmapForWrite (because we can continue to add to the back of
the bitmapsToWrite ArrayList) while ensuring that the bitmaps are
returned in the correct ordering from getCompressedBitmaps.

Change-Id: If7364222b9e62920c0c2c06894716fe85dd13315

7 months agoDfsPackFile: Make the loader classes used to construct bitmaps public. 65/1190165/11
jackdt@google.com [Mon, 1 Apr 2024 17:46:15 +0000 (10:46 -0700)]
DfsPackFile: Make the loader classes used to construct bitmaps public.

This is necessary to swap out implementations of the PackBitmapIndex
with custom implementations.

Change-Id: Ia6f951bbc901446c255fa2902fab05d7ed974111

7 months agoDfsPackFile: make public the constructor with bitmap loader 69/1190169/2
Ivan Frade [Mon, 1 Apr 2024 19:58:27 +0000 (12:58 -0700)]
DfsPackFile: make public the constructor with bitmap loader

The constructor with the bitmap loader as a parameter is supposed to
be used from subclasses in the ObjectDatabase, but those subclasses
cannot see it with its current package-private visibility.

Make it public, so it can be used as intended.

Change-Id: I4afca3d2a13c4a41a766d08c5aa54bde352915a6

7 months agoPackWriter: writeBitmapIndex takes bitmap index writer 22/1177722/21
Sam Delmerico [Tue, 5 Mar 2024 01:40:37 +0000 (17:40 -0800)]
PackWriter: writeBitmapIndex takes bitmap index writer

PackWriter.writeBitmapIndex now takes an interface which will perform
the writing of the bitmap index to an arbitrary backing storage.

Change-Id: Icba89321d56f7b652bbcbfcd5ed3ec74999cb8c4

7 months agoAdd more tests on rewriting parents in a RevWalk 89/1178189/5
Max Haslbeck [Tue, 12 Mar 2024 13:23:20 +0000 (13:23 +0000)]
Add more tests on rewriting parents in a RevWalk

Change I4e4ff67fb279edbcc3461496b132cea774fb742f introduced new
behaviour that also rewrote parents in a RevWalk if no TreeFilter was
set. This led to unexpected behaviour when users were fetching from
chromium.googlesource.com. I added a few more tests to better describe
the behaviour of RevWalk in regards to rewriting parents.

Change-Id: I1a5e5f8a1de9d8dd0e3664918ac010644b3ef87b
Signed-off-by: Max Haslbeck <haslbeck@google.com>
7 months agoPackBitmapIndex: convert from class to interface 40/1187440/2
Sam Delmerico [Mon, 25 Mar 2024 17:52:26 +0000 (10:52 -0700)]
PackBitmapIndex: convert from class to interface

This abstract class can be an interface after
https://review.gerrithub.io/c/eclipse-jgit/jgit/+/1184614 moved the
packChecksum data behind a getter interface. This also allows easier
overriding of this interface with custom types.

Change-Id: I89851de678e7ff896cc086455907e2898d2eecf6

8 months agoMerge "DfsGarbageCollectorTest: add test for bitmap index creation"
Ivan Frade [Wed, 20 Mar 2024 22:53:31 +0000 (22:53 +0000)]
Merge "DfsGarbageCollectorTest: add test for bitmap index creation"

8 months agoMerge "PackBitmapIndex: hide packChecksum behind getter"
Ivan Frade [Wed, 20 Mar 2024 22:49:43 +0000 (22:49 +0000)]
Merge "PackBitmapIndex: hide packChecksum behind getter"

8 months agoMerge "Cache refreshed loose ref dirs in SnapshottingRefDirectory"
Matthias Sohn [Wed, 20 Mar 2024 07:20:25 +0000 (07:20 +0000)]
Merge "Cache refreshed loose ref dirs in SnapshottingRefDirectory"

8 months agoMerge "TreeRevFilter: correct changedPathFilter usage for multi-paths inclusion"
jonathantanmy [Tue, 19 Mar 2024 22:13:36 +0000 (22:13 +0000)]
Merge "TreeRevFilter: correct changedPathFilter usage for multi-paths inclusion"

8 months agoCache refreshed loose ref dirs in SnapshottingRefDirectory 41/205141/6
Nasser Grainawi [Fri, 23 Feb 2024 17:34:37 +0000 (09:34 -0800)]
Cache refreshed loose ref dirs in SnapshottingRefDirectory

Update SnapshottingRefDirectory to have a cache of dirs refreshed for
loose refs. This should help improve performance when 'after_open'
setting is used for 'trustLooseRefStat' as duplicate refreshes are
avoided when a snapshot of the ref database is used in a request scope.

Change-Id: I8f66e7cee572e477d29abe2d9db69e97bca3ee4c
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
Co-authored-by: Martin Fick <quic_mfick@quicinc.com>
Co-authored-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
8 months agoDfsGarbageCollectorTest: add test for bitmap index creation 37/1177837/7
Sam Delmerico [Wed, 6 Mar 2024 21:24:16 +0000 (13:24 -0800)]
DfsGarbageCollectorTest: add test for bitmap index creation

Change-Id: Ibb9b2f8fc0f5180728904f243bf372f8a233383d

8 months agoPackBitmapIndex: hide packChecksum behind getter 14/1184614/1
Sam Delmerico [Tue, 19 Mar 2024 00:14:24 +0000 (17:14 -0700)]
PackBitmapIndex: hide packChecksum behind getter

This allows more flexibility in overriding the PackBitmapIndex and also
allows us to turn PackBitmapIndex into an interface in
https://review.gerrithub.io/c/eclipse-jgit/jgit/+/1178201.

Change-Id: I3be611fad67ff38b308c0052a04149f1497858ae

8 months agoMerge "CleanupService: preload JgitText if not running in OSGi"
Thomas Wolf [Mon, 18 Mar 2024 19:49:37 +0000 (19:49 +0000)]
Merge "CleanupService: preload JgitText if not running in OSGi"

8 months agoTreeRevFilter: correct changedPathFilter usage for multi-paths inclusion 82/1177882/16
Xing Huang [Thu, 7 Mar 2024 17:41:36 +0000 (11:41 -0600)]
TreeRevFilter: correct changedPathFilter usage for multi-paths inclusion

The expected behavior of TreeRevFilter when filtering multiple file
paths is to include commits that changed at least one of the given
paths; only skipping them if they did not change any of the given
paths. The current changedPathFilter utilization logic is skipping a
commit if there exists at least one given path that the commit did not
change, disregarding the rest of the given paths.

Enforcing all given paths to be checked by the changedPathFilter, only
skipping a commit if changedPathFilter return negative on all given
paths.

Signed-off-by: Xing Huang <xingkhuang@google.com>
Change-Id: Ib7a9e496b37ec737722fbf33c5d0f05d5d910a8d

8 months agoPathFilterGroup: implement getPathsBestEffort() 17/1184117/2
Xing Huang [Fri, 15 Mar 2024 20:19:15 +0000 (15:19 -0500)]
PathFilterGroup: implement getPathsBestEffort()

getPathsBestEffort() is a method in the TreeFilter class
to retrieve file paths specified by the caller. PathFilterGroup do not
propagate the paths of their subfilters as it does not implement the
getPathsBestEffort() method, resulting in the caller only getting an
empty list of paths.

Override getPathsBestEffort() in PathFilterGroup to propagate subfilter
values.

Signed-off-by: Xing Huang <xingkhuang@google.com>
Change-Id: I76bf08795360abc0874a7c258636d4f37da35060

8 months agoCleanupService: preload JgitText if not running in OSGi 44/1183644/1
Thomas Wolf [Sun, 10 Mar 2024 18:37:51 +0000 (19:37 +0100)]
CleanupService: preload JgitText if not running in OSGi

Load class JGitText eagerly when ShutdownHook is used. If not running
in an OSGi framework, the hook executes as a JVM shutdown hook. Normally
classloading in a shutdown hook should not be a problem, but there are
some other frameworks besides OSGi that may close classloaders before
such a JVM shutdown hook runs, for instance Plexus classworlds used in
maven.

This is not a full fix for classloading problems in JGit shutdown hooks.
If a listener causes additional classes to be loaded, there may still
be problems. But the current listeners registered with ShutdownHook all
appear to use only classes that should already be loaded; except
JGitText.

Bug: jgit-36
Change-Id: Iab00134b4720adb19e1394c38ad79f1c43c3466b
Signed-off-by: Thomas Wolf <twolf@apache.org>
8 months agoDfsPackFile: get commitGraph.readChangePaths from repo config 98/1178198/8
Xing Huang [Tue, 12 Mar 2024 21:32:46 +0000 (16:32 -0500)]
DfsPackFile: get commitGraph.readChangePaths from repo config

By default, CommitGraphLoader reads the readChangedPaths flag from
SystemReader ignoring the values set at repo-level.

Read the value of the property from the repo configuration and pass it
to CommitGraphLoader.

Signed-off-by: Xing Huang <xingkhuang@google.com>
Change-Id: I34c807714c5a7573769ba9d611457aa107006244

8 months agoMerge "CommitGraphLoader: receive readChangedPaths as parameter"
Ivan Frade [Tue, 12 Mar 2024 23:07:32 +0000 (23:07 +0000)]
Merge "CommitGraphLoader: receive readChangedPaths as parameter"

8 months agoCommitGraphLoader: receive readChangedPaths as parameter 97/1178197/3
Xing Huang [Tue, 12 Mar 2024 21:24:10 +0000 (16:24 -0500)]
CommitGraphLoader: receive readChangedPaths as parameter

commitGraph.readChangedPaths controls the read of bloom filter
chunks from commit graph. CommitGraphLoader uses SystemReader
to read this conf, so it only sees its value when it is set in
$XDG_CONFIG_HOME/jgit/config (and not, for example, in the repo
config).

Pass the readChangedPaths value to the method that reads the commit
graph. Callers should read the value from the right configuration.

This change is a noop, but allows to move callers to the new method
progressively. Follow up changes will remove the previous method and
its usages.

Signed-off-by: Xing Huang <xingkhuang@google.com>
Change-Id: If10c9b758fbe0498c7bd1e6ac1cda8869682f16d

8 months agoMerge "Add pull request template discouraging usage of pull requests"
Matthias Sohn [Mon, 11 Mar 2024 22:00:59 +0000 (22:00 +0000)]
Merge "Add pull request template discouraging usage of pull requests"

8 months agoAdd pull request template discouraging usage of pull requests 75/1177775/1
Matthias Sohn [Mon, 11 Mar 2024 14:04:27 +0000 (15:04 +0100)]
Add pull request template discouraging usage of pull requests

since we use Gerrit for code review.

Change-Id: I2eeea82452d678564e17e3db9bd6ca7ef4ae4cc2

8 months agoUpdate CONTRIBUTING.md to point to GitHub issues 77/1177977/1
Antonin Delpeuch [Sun, 10 Mar 2024 20:41:33 +0000 (21:41 +0100)]
Update CONTRIBUTING.md to point to GitHub issues

With a link to older bugs in Bugzilla.
I have no idea if this is an accurate description of the situation,
it's all guesswork on my part.

Signed-off-by: Antonin Delpeuch <antonin@delpeuch.eu>
Change-Id: I019689115a744daf588a86b44e998d2dfe03d4b5

8 months agoMerge "ShutdownHook: run on bundle deactivation if in OSGi"
Matthias Sohn [Sat, 9 Mar 2024 23:49:14 +0000 (23:49 +0000)]
Merge "ShutdownHook: run on bundle deactivation if in OSGi"

8 months agoFS_POSIX.runInShell(): on MacOS use a login shell 12/1177212/3
Thomas Wolf [Wed, 21 Feb 2024 21:52:45 +0000 (22:52 +0100)]
FS_POSIX.runInShell(): on MacOS use a login shell

On Mac, $PATH for UI programs is not the same as in a shell (terminal).
It is typically much shorter. This may lead to surprises when hooks that
work fine via the command-line git do not work when run via JGit in a UI
application, such as EGit in Eclipse.

Therefore use a login shell to run hooks and other commands spawned by
git if we're on MacOS. This will give the hooks the same environment as
in a terminal.

Bug: egit-16
Change-Id: Id2e5485c6d3080d3ef8baa61ad7f6f198f77c590
Signed-off-by: Thomas Wolf <twolf@apache.org>
8 months ago[ssh] Implement the "Ciphers" SSH config 11/1177211/2
Thomas Wolf [Sat, 3 Feb 2024 21:22:16 +0000 (22:22 +0100)]
[ssh] Implement the "Ciphers" SSH config

Upstream will remove the CBC algorithms aes128-cbc, aes192-cbc, and
aes256-cbc from the server's KEX proposal in the next release. Removal
of these algorithms by default in the client is planned for the release
after that. These CBC algorithms were found vulnerable back in 2008,[1]
and OpenSSH does not propose them: server-side since 2014, client-side
since 2017.

It is _highly_ unlikely that the removal of these algorithms by default
would affect any JGit user. Nevertheless, let's give users a way to
explicitly specify ciphers (including enabling deprecated algorithms)
via their ~/.ssh/config file.

[1] https://www.kb.cert.org/vuls/id/958563

Change-Id: I7444861df3a7f526277fef2485773a20ac74ae8a
Signed-off-by: Thomas Wolf <twolf@apache.org>
8 months agoShutdownHook: run on bundle deactivation if in OSGi 51/1177951/1
Thomas Wolf [Fri, 8 Mar 2024 18:48:27 +0000 (19:48 +0100)]
ShutdownHook: run on bundle deactivation if in OSGi

Running as a JVM shutdown hook is far too late in an OSGi framework; by
the time the JVM shuts down, the OSGi framework will normally already
have deactivated and unloaded bundles, and thus the JGit cleanup code
may try to work with unloaded classes for which there will be no
classloader anymore.

When JGit is used in an OSGi framework, the cleanups must run on bundle
deactivation, not on JVM shut down.

Add a declarative OSGi service CleanupService. This is a normal Java
class that has no dependencies on any OSGi bundle or interface, but
that is declared in the MANIFEST.MF and in an OSGi Service XML as an
OSGi immediate component. Set the bundle activation policy to "lazy".
(A declarative service is used instead of a bundle activator because the
latter would need to implement the OSGi interface BundleActivator, but
JGit should not have dependencies on OSGi.)

When JGit runs in an OSGi framework, the framework will create an
instance of CleanupService through the no-args constructor when (and
before) the first class from this bundle is loaded. This instance thus
knows that it is operating in OSGi, and will run the ShutdownHook when
the bundle is deactivated: bundle deactivation will deactivate the
CleanupService instance.

When JGit does not run in an OSGi framework, the OSGi service
declaration will be ignored, and there will be no already existing
CleanupService instance. We create one lazily, which thus knows that
it is not operating in OSGi, and which will use a JVM shutdown hook to
run the ShutdownHook.

This also reverts commit e6d83d61eade6dee223757d149a4df9650752a55.

Bug: jgit-36
Change-Id: I9c621b0707453c087f638974312ea1bf8ec30c31
Signed-off-by: Thomas Wolf <twolf@apache.org>
8 months ago[diffmergetool] Fix running command on Cygwin 80/1177880/1
Thomas Wolf [Thu, 7 Mar 2024 21:42:27 +0000 (22:42 +0100)]
[diffmergetool] Fix running command on Cygwin

Because FS_Win32_Cygwin is a subclass of FS_Win32 the "instanceof" test
for Cygwin must come first.

Bug: jgit-34
Change-Id: If0cc0fa77e7aa0ce680289cecf808bc8859911a1
Signed-off-by: Thomas Wolf <twolf@apache.org>
8 months ago[releng] Bump japicmp base version to 6.9.0.202403050737-r 79/1177879/1
Thomas Wolf [Thu, 7 Mar 2024 21:57:44 +0000 (22:57 +0100)]
[releng] Bump japicmp base version to 6.9.0.202403050737-r

Change-Id: I6008ef632e6cd88d337ac5b888b52a4b1d3ca85f
Signed-off-by: Thomas Wolf <twolf@apache.org>
8 months agoDfsBlockCache: move cache table specific implementations to a new class 15/1177515/7
Laura Hamelin [Tue, 27 Feb 2024 17:40:24 +0000 (09:40 -0800)]
DfsBlockCache: move cache table specific implementations to a new class

This move of the cache table specific implementation to its own class
and extracting the method definition to an interface will allow for
additional reworking of the dfs block cache with the goal of letting
users implement their own context specific cache tables.

This work does not intend to change how the dfs block cache is accessed,
limiting the change to DfsBlockCache internal changes only.

Change-Id: Ief6755d1dcf54b4f73f9fe8d22ccb9e2952cb0c4
Signed-off-by: Laura Hamelin <haowl@google.com>
8 months agoPrepare 6.10.0-SNAPSHOT builds 70/1177370/1
Matthias Sohn [Tue, 5 Mar 2024 15:23:17 +0000 (16:23 +0100)]
Prepare 6.10.0-SNAPSHOT builds

Change-Id: Ie728ef9a7d3c6430a5da30f6a61afd2176015748

8 months agoMerge branch 'stable-6.9' 69/1177369/1
Matthias Sohn [Tue, 5 Mar 2024 15:22:35 +0000 (16:22 +0100)]
Merge branch 'stable-6.9'

* stable-6.9:
  Prepare 6.9.1-SNAPSHOT builds
  JGit v6.9.0.202403050737-r
  JGit v6.9.0.202403050045-r
  Prepare 6.9.0-SNAPSHOT builds
  JGit v6.9.0.202402281855-rc1
  Prepare 6.9.0-SNAPSHOT builds
  JGit v6.9.0.202402211805-m3

Change-Id: I08175c3bced7f94507a4def8fbf58c7d570e353c

8 months agoPrepare 6.9.1-SNAPSHOT builds 68/1177368/1
Matthias Sohn [Tue, 5 Mar 2024 14:55:07 +0000 (15:55 +0100)]
Prepare 6.9.1-SNAPSHOT builds

Change-Id: I10f901209be2faa34ebb9355c86c2106bac38ba5

8 months agoJGit v6.9.0.202403050737-r 66/1177366/1 v6.9.0.202403050737-r
Matthias Sohn [Tue, 5 Mar 2024 07:36:32 +0000 (08:36 +0100)]
JGit v6.9.0.202403050737-r

Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I70494c0c69ac549dea9b4cf7c5b25e94c1b4b250

8 months agoJGit v6.9.0.202403050045-r 65/1177365/1 v6.9.0.202403050045-r
Matthias Sohn [Tue, 5 Mar 2024 00:43:03 +0000 (01:43 +0100)]
JGit v6.9.0.202403050045-r

Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I4c7a6542ad4252c5a9499e69f68650d2026bde40

8 months agoMerge branch 'master' into stable-6.9 62/1177362/1
Matthias Sohn [Mon, 4 Mar 2024 23:39:56 +0000 (00:39 +0100)]
Merge branch 'master' into stable-6.9

* master:
  Introduce core.trustLooseRefStat config

Change-Id: I373138c4334d94b3e1e4335ee555b68f907d4c89

8 months agoPrepare 6.9.0-SNAPSHOT builds 61/1177361/1
Matthias Sohn [Mon, 4 Mar 2024 23:39:41 +0000 (00:39 +0100)]
Prepare 6.9.0-SNAPSHOT builds

Change-Id: Ifadeead735c8772e58dd4e5c7381b44c5221a295

8 months agoIntroduce core.trustLooseRefStat config 16/1177316/7
Kaushik Lingarkar [Thu, 22 Feb 2024 23:29:48 +0000 (15:29 -0800)]
Introduce core.trustLooseRefStat config

With repositories on NFS, JGit can read an old value of a loose ref
or miss the existence of a loose ref if file attributes of the loose
ref or its parent directories are cached by NFS. Introduce a new config
'core.trustLooseRefStat' that will optionally refresh file attributes of
the loose ref (at least on some NFS clients).

Possible values for this new config are:

* always: Trust loose ref file attributes (default)
* after_open: Similar to 'always', but refresh the file attributes of
              the loose ref and its parent directories before trusting
              it

The default is set to always trust the file attributes as after_open is
known to degrade performance.

In a subsequent change, SnapshottingRefDirectory will be updated to
cache the directories that were refreshed to avoid duplicate work and
thereby improve performance to some extent for the after_open setting.

Change-Id: I9dfaeaf5307b2b51ce6ee4bfd9e0678786685fcf
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
8 months agoJGit v6.9.0.202402281855-rc1 58/1177358/1 v6.9.0.202402281855-rc1
Matthias Sohn [Wed, 28 Feb 2024 18:54:54 +0000 (19:54 +0100)]
JGit v6.9.0.202402281855-rc1

Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I23d489ccdc257a8c25da4b90dc51d4a8951d320c

8 months agoMerge branch 'master' into stable-6.9 56/1177356/1
Matthias Sohn [Wed, 28 Feb 2024 18:43:26 +0000 (19:43 +0100)]
Merge branch 'master' into stable-6.9

* master:
  Update SECURITY.md
  DfsObjDatabase: Let object database instantiate DfsPackFiles
  DfsPackFile: Abstract the bitmap loading to support other backends
  Remove unused API problem filters
  Support public key in IdentityFile
  Revert "StartGenerator: Fix parent rewrite with non-default RevFilter"
  DfsReader#getObjectSize: use size index if possible

Change-Id: I60244aec1e44fe5b757a9b7ccb320697e0dc9b29

8 months agoMerge "Update SECURITY.md"
Matthias Sohn [Wed, 28 Feb 2024 13:14:02 +0000 (13:14 +0000)]
Merge "Update SECURITY.md"

8 months agoUpdate SECURITY.md 52/1177352/1
Matthias Sohn [Tue, 27 Feb 2024 23:40:34 +0000 (00:40 +0100)]
Update SECURITY.md

Use the text of the general Eclipse Vulnerability Reporting page at
https://www.eclipse.org/security.

Bug: jgit-31
Change-Id: I07dcf83199956e0173f958356661ade33252dab4

8 months agoDfsObjDatabase: Let object database instantiate DfsPackFiles 80/1177280/6
Ivan Frade [Thu, 22 Feb 2024 22:15:10 +0000 (14:15 -0800)]
DfsObjDatabase: Let object database instantiate DfsPackFiles

DfsPackfile used to have only one constructor and it is invoked from 3
locations. Now we can construct DfsPackFiles with different bitmap
loaders, so it is helpful to concentrate the instantiation in one location.

Create DfsPackFile instances in the object database. This let
subclasses choose how to initialize those instances.

Change-Id: Ibb2ad86865154b6e7f0d5d26e8f533e0b5586246

8 months agoDfsPackFile: Abstract the bitmap loading to support other backends 62/1177262/5
Ivan Frade [Wed, 21 Feb 2024 23:06:38 +0000 (15:06 -0800)]
DfsPackFile: Abstract the bitmap loading to support other backends

Current code reads the bitmap index from the pack extension and loads
all bitmaps into memory, with its IO and memory cost. We could
consider to store the bitmaps on e.g. a database and load them on
demand.

Abstract the loading of the PackBitmapIndex in an interface that can
be implemented with other backends.

Change-Id: Ib5f64d05954708ea5325feea7088a8df229b36a5

8 months agoRemove unused API problem filters 51/1177351/1
Matthias Sohn [Sun, 25 Feb 2024 22:28:33 +0000 (23:28 +0100)]
Remove unused API problem filters

Change-Id: I0d81fda5edde5348e765eebc39bd9293fba51e91

8 months agoMerge "Support public key in IdentityFile"
Thomas Wolf [Fri, 23 Feb 2024 12:30:07 +0000 (12:30 +0000)]
Merge "Support public key in IdentityFile"

8 months agoMerge "DfsReader#getObjectSize: use size index if possible"
Ivan Frade [Fri, 23 Feb 2024 00:23:43 +0000 (00:23 +0000)]
Merge "DfsReader#getObjectSize: use size index if possible"

8 months agoSupport public key in IdentityFile 73/1177073/6
Konrad Windszus [Tue, 20 Feb 2024 13:30:39 +0000 (14:30 +0100)]
Support public key in IdentityFile

Public keys in the SSH configuration's "IdentityFile" are used for
example by Password Managers like KeePassXC
(https://keepassxc.org/docs/#faq-ssh-agent-auth-errors) or 1Password
(https://developer.1password.com/docs/ssh/agent/advanced/#match-key-with-host)
to match keys in the SSH agent with specific hosts.

Bug: jgit-25
Change-Id: I33d47057d9dd54d3d08ba5bb17f730435ac93dac

8 months agoMerge "Revert "StartGenerator: Fix parent rewrite with non-default RevFilter""
Ivan Frade [Thu, 22 Feb 2024 05:40:55 +0000 (05:40 +0000)]
Merge "Revert "StartGenerator: Fix parent rewrite with non-default RevFilter""

8 months agoRevert "StartGenerator: Fix parent rewrite with non-default RevFilter" 16/1177216/1
Ivan Frade [Wed, 21 Feb 2024 23:28:03 +0000 (15:28 -0800)]
Revert "StartGenerator: Fix parent rewrite with non-default RevFilter"

This reverts commit db5ce6b5c24408ae27eb6fa0b6289d51b129baeb.

Reason to revert: This change utilizes the RewriteGenerator even in
absence of a path, making the walk lengthy.

Change-Id: I5ffa6e8fead328191348c1e46828bf8c75ae1e42

8 months agoPrepare 6.9.0-SNAPSHOT builds 99/1177199/1
Matthias Sohn [Wed, 21 Feb 2024 23:11:24 +0000 (00:11 +0100)]
Prepare 6.9.0-SNAPSHOT builds

Change-Id: I11f4871bfdf6c6c0de5d5ed577edf16bac8cf681

9 months agoJGit v6.9.0.202402211805-m3 96/1177196/1 v6.9.0.202402211805-m3
Matthias Sohn [Wed, 21 Feb 2024 18:04:49 +0000 (19:04 +0100)]
JGit v6.9.0.202402211805-m3

Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: Id2f3934947d6d1e94feeb9e73ad7282ae089b682

9 months agoMerge branch 'stable-6.8' 94/1177194/1
Matthias Sohn [Wed, 21 Feb 2024 17:18:31 +0000 (18:18 +0100)]
Merge branch 'stable-6.8'

* stable-6.8:
  Delete org.eclipse.jgit.ssh.apache.agent/bin/.project
  Allow to discover bitmap on disk created after the packfile

Change-Id: I08095dfaefb963876d993383cb35acc6b75d7691

9 months agoMerge branch 'stable-6.7' into stable-6.8 93/1177193/1
Matthias Sohn [Wed, 21 Feb 2024 16:55:22 +0000 (17:55 +0100)]
Merge branch 'stable-6.7' into stable-6.8

* stable-6.7:
  Delete org.eclipse.jgit.ssh.apache.agent/bin/.project
  Allow to discover bitmap on disk created after the packfile

Change-Id: I01749bae6f46d1a8ebd25b890e667cc092f3a659

9 months agoMerge branch 'stable-6.6' into stable-6.7
Matthias Sohn [Wed, 21 Feb 2024 16:41:44 +0000 (17:41 +0100)]
Merge branch 'stable-6.6' into stable-6.7

* stable-6.6:
  Delete org.eclipse.jgit.ssh.apache.agent/bin/.project
  Allow to discover bitmap on disk created after the packfile

Change-Id: I2bbc8c9a4ed45d37fa7ba63b2afd5511b6cf47a2

9 months agoDelete org.eclipse.jgit.ssh.apache.agent/bin/.project 91/1177191/1
Matthias Sohn [Wed, 21 Feb 2024 15:43:43 +0000 (16:43 +0100)]
Delete org.eclipse.jgit.ssh.apache.agent/bin/.project

Change-Id: If2f50f81ffb8b5a1929b0ce403bff017ece29e2f

9 months agoAllow to discover bitmap on disk created after the packfile 96/1174396/15
Luca Milanesio [Wed, 10 Jan 2024 19:38:46 +0000 (19:38 +0000)]
Allow to discover bitmap on disk created after the packfile

When the bitmap file was created *after* a packfile had been
loaded into the memory, JGit was unable to discover them.

That happed because of two problems:

1. The PackDirectory.getPacks() does not implement the usual
   while loop that is scanning through the packs directory
   as in the other parts of JGit.

2. The scan packs does not look for newly created bitmap files
   if the packfile is already loaded in memory.

Implement the normal packfiles scanning whenever the PackDirectory
needs to return a list of packs, and make sure that any reused
Pack object would have its associated bitmap properly refreshed
from disk.

Adapt the assertions in GcConcurrentTest with the rescanned list
of Pack from the objects/packs directory.

Bug: jgit-15
Change-Id: I2ed576cefd78a0e128b175228a59c9af51523d7b