jgit/org.eclipse.jgit.test/tst/org/eclipse/jgit
Christian Halstrick 1ed1e40387 Fix exception handling for opening bitmap index files
When creating a new PackFile instance it is specified whether this pack
has an associated bitmap index file or not. This information is cached
and the public method getBitmapIndex() will always assume a bitmap index
file must exist if the cached data tells so. But it may happen that the
packfiles are repacked during a gc in a different process causing the
packfile, bitmap-index and index file to be deleted. Since JGit still
has an open FileHandle on the packfile this file is not really deleted
and can still be accessed. But index and bitmap index file are deleted.
Fix getBitmapIndex() to invalidate the cached packfile instance if such
a situation occurs.

This problem showed up when a gerrit server was serving repositories
which where garbage collected with native git regularly. Fetch and
clone commands for certain repositories failed permanently after a
native git gc had deleted old bitmap index files.

Change-Id: I8e620bec74dd3f310ba42024f9a657062f868f0e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-08-14 21:09:48 +02:00
..
api Handle all values of branch.[name].rebase 2016-09-15 00:44:23 +02:00
attributes Add Attribute Macro Expansion 2016-02-11 17:08:49 +01:00
diff PatchIdDiffFormatterTest: Open Git and PatchIdDiffFormatter in try-with-resource 2016-02-12 14:07:53 +09:00
dircache DirCacheBasicTest: Open ObjectInserter.Formatter in try-with-resource 2016-02-15 17:19:17 +09:00
events Move base test classes to the junit bundle for reuse for Java 7 tests 2013-02-04 07:24:56 +01:00
fnmatch Added characters to be escaped in file name patterns 2013-04-06 18:23:33 +02:00
gitrepo Fix javadoc errors and unused imports introduced by ddd0fe25 2016-06-01 10:17:29 +02:00
ignore Ignore trailing spaces in directory rule patterns 2016-09-14 07:43:52 -04:00
internal/storage Fix exception handling for opening bitmap index files 2017-08-14 21:09:48 +02:00
junit Clarify the semantics of DfsRefDatabase#compareAndPut 2016-08-25 19:12:39 -07:00
lib Fix eviction of repositories with negative usage count 2016-10-12 07:07:03 -04:00
merge Use FS#lastModified instead of File#lastModified 2016-08-24 09:07:08 +02:00
nls Move console classes to pgm bundle 2015-02-10 09:14:48 +01:00
notes NoteMapTest: Add missing @Test annotations 2016-08-26 00:12:32 +02:00
patch Suppress boxing warnings where we know they are ok 2012-09-22 01:21:00 +02:00
revplot Revert "CommitBuilder should check for duplicate parents" 2015-03-18 16:26:05 -07:00
revwalk Fix carrying over flags during a RevWalk 2016-09-23 11:15:08 +02:00
storage/file Remove hardcoded target/trash from test cases 2013-11-01 19:57:47 -07:00
submodule SubmoduleAddTest: Open Git in try-with-resource 2016-02-05 14:11:54 +09:00
symlinks SymlinksTest: Open git and TreeWalk in try-with-resource 2016-02-05 14:05:22 +09:00
test/resources Move SampleDataRepositoryTestCase to org.eclipse.jgit.test 2013-11-24 05:27:14 -05:00
transport ReceivePack: refactor push option parsing 2016-08-26 14:53:54 -07:00
treewalk Use FS#lastModified instead of File#lastModified 2016-08-24 09:07:08 +02:00
util Add support for post-commit hooks 2016-09-13 17:13:48 +02:00