]> source.dussan.org Git - jgit.git/commit
Allow to discover bitmap on disk created after the packfile 96/1174396/15
authorLuca Milanesio <luca.milanesio@gmail.com>
Wed, 10 Jan 2024 19:38:46 +0000 (19:38 +0000)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 20 Feb 2024 21:54:54 +0000 (22:54 +0100)
commit3e624306dea4de6f7a78a7bcf34a57882f731a2d
tree73cb3406d8d5eb70c1c75be65f47dae2ce2ef0d0
parentacf21c0bc6a63a3d20fca92757b992a1f2d55f41
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
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/Pack.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackDirectory.java