jgit/org.eclipse.jgit.test
Shawn O. Pearce 06ee913c8d IndexPack: Correct thin pack fix using less than 20 bytes
If we need to append less than 20 bytes in order to fix a thin pack
and make it complete, we need to set the length of our file back to
the actual number of bytes used because the original SHA-1 footer was
not completely overwritten.  That extra data will confuse the header
and footer fixup logic when it tries to read to the end of the file.

This isn't a very common case to occur, which is why we've never
seen it before.  Getting a delta that requires a whole object which
uses less than 20 bytes in pack representation is really hard.
Generally a delta generator won't make these, because the delta
would be bigger than simply deflating the whole object.  I only
managed to do this with a hand-crafted pack file where a 1 byte
delta was pointed to a 1 byte whole object.

Normally we try really hard to avoid truncating, because its
typically not safe across network filesystems.  But the odds of
this occurring are very low.  This truncation is done on a file
we have open for writing, will append more content onto, and is
a temporary file that we won't move into position for others to
see until we've validated its SHA-1 is sane.  I don't think the
truncate on NFS issue is something we need to worry about here.

Change-Id: I102b9637dfd048dc833c050890d142f43c1e75ae
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-04-16 15:56:23 -07:00
..
.settings Fix code formatter style references 2010-01-05 11:47:49 -08:00
META-INF JGit plugin not compatible with Eclipse 3.4 2010-04-05 12:25:06 +02:00
exttst/org/eclipse/jgit Refactor TemporaryBuffer to support reuse in other contexts 2010-01-12 11:56:55 -08:00
tst/org/eclipse/jgit IndexPack: Correct thin pack fix using less than 20 bytes 2010-04-16 15:56:23 -07:00
tst-rsrc/org/eclipse/jgit Correctly skip over unrecognized optional dircache extensions 2010-02-02 09:09:26 -08:00
.classpath Partial revert "Switch build to Apache Felix maven-bundle-plugin" 2010-01-10 15:59:03 +01:00
.gitignore Finish removing Apache Felix maven-bundle-plugin 2010-01-12 11:46:55 -08:00
.project Partial revert "Switch build to Apache Felix maven-bundle-plugin" 2010-01-10 15:59:03 +01:00
build.properties Partial revert "Switch build to Apache Felix maven-bundle-plugin" 2010-01-10 15:59:03 +01:00
org.eclipse.jgit.core--All-External-Tests (Java 6).launch Partial revert "Switch build to Apache Felix maven-bundle-plugin" 2010-01-10 15:59:03 +01:00
org.eclipse.jgit.core--All-External-Tests.launch Partial revert "Switch build to Apache Felix maven-bundle-plugin" 2010-01-10 15:59:03 +01:00
org.eclipse.jgit.core--All-Tests (Java 6).launch Partial revert "Switch build to Apache Felix maven-bundle-plugin" 2010-01-10 15:59:03 +01:00
org.eclipse.jgit.core--All-Tests.launch Partial revert "Switch build to Apache Felix maven-bundle-plugin" 2010-01-10 15:59:03 +01:00
plugin.properties Correct bundle, provider names to be consistent 2010-01-23 11:42:15 -08:00
pom.xml Qualify builds as 0.8.0 2010-03-20 19:06:58 -07:00