Introduce a new exception type for an in-place pack modification
commit3da8761ffdb95a8aa2707dd5fe0b58b56bc39cda
authorShawn O. Pearce <spearce@spearce.org>
Tue, 21 Apr 2009 01:21:07 +0000 (20 18:21 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Thu, 23 Apr 2009 22:25:57 +0000 (24 00:25 +0200)
tree1a380ebfe5b62692175ef17a06ed6256a54b1e3c
parent44035400f543476c479d276b23156dcf83a4951d
Introduce a new exception type for an in-place pack modification

If a pack file is modified in place by "git gc" or "git repack"
it means that the list of objects contained within the pack has
not changed, but it is possible for the layout of the pack to
be modified.

The layout can change when the compressed version of any object
is changed, and usually happens because the packer has found a
smaller way to represent a contained object.  It also can change
if an object's delta base encoding format is switched, such as from
OBJ_REF to OBJ_OFS.

This new exception type can be caught by callers to recognize that
the object contents of the pack is quite likely the same, but that
any offsets and cached windows are wrong and need to be computed
or loaded again.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit/src/org/spearce/jgit/errors/PackMismatchException.java [new file with mode: 0644]
org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java