diff options
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java index 23faa42a24..29f200c52d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java @@ -601,6 +601,14 @@ public class IndexPack { throw new MissingObjectException(base, "delta base"); } + if (end - originalEOF < 20) { + // Ugly corner case; if what we appended on to complete deltas + // doesn't completely cover the SHA-1 we have to truncate off + // we need to shorten the file, otherwise we will include part + // of the old footer as object content. + packOut.setLength(end); + } + fixHeaderFooter(packcsum, packDigest.digest()); } |