Object validation tests for "jgit fsck"
commit8a3079ea5e20d5d30aa9a2923c2606f85cf5f28f
authorShawn O. Pearce <spearce@spearce.org>
Wed, 1 Oct 2008 01:31:28 +0000 (30 18:31 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Fri, 3 Oct 2008 06:22:55 +0000 (3 08:22 +0200)
tree82e007f95742bc3439602d3dd6428dde6febe757
parent4c49ab5a4ec8555681ceabf17142a15bf90c2c24
Object validation tests for "jgit fsck"

The ObjectChecker provides strict validation rules for objects.  If
any commit, tag or tree object is malformed in a way that might cause
a Git implementation to misinterpret the data CorruptObjectException
is thrown back to the caller for error handling.

Due to the shear size of the validation code this change provides
only the validation code and its unit tests.  It is at least as
paranoid as git.git's "git-fsck" is on the same object types, but
is actually a bit stricter about the commit and tag objects having
the well known header fields populated correctly.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit.test/tst/org/spearce/jgit/lib/ObjectCheckerTest.java [new file with mode: 0644]
org.spearce.jgit/src/org/spearce/jgit/lib/ObjectChecker.java [new file with mode: 0644]
org.spearce.jgit/src/org/spearce/jgit/util/RawParseUtils.java