{"thread":{"id":"28874","subject":"git fsck: failed to apply delta","startedAt":"2011-11-07T14:25:37Z","lastAt":"2011-11-07T14:25:37Z","messageCount":1,"participants":["Andre Noll"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"179036","messageId":"20111107142537.GD13394@systemlinux.org","threadId":"28874","inReplyTo":null,"subject":"git fsck: failed to apply delta","fromName":"Andre Noll","fromEmail":"maan@systemlinux.org","sentAt":"2011-11-07T14:25:37Z","receivedAt":"2011-11-07T14:25:37Z","isPatch":false,"sender":{"key":"maan@systemlinux.org","avatar":null},"body":"Hi\n\nI'm getting this when running git fsck or git repack against a large\n(21G) repo which was created from subversion using git svn clone:\n\n\tfatal: failed to apply delta\n\nThe debugging patch below indicates that this repo fails the sanity\ncheck for the size in patch_delta(). With this patch applied I'm\ngetting the following additional output\n\n\terror: bad delta header size, expected: 236, have 1994568\n\nThis is 100% reproducible. I'm using the git master branch as of\ntoday (5ae0f681) but the same problem showed up also with an older\ngit version.\n\nDoes anybody know what's going on here?\n\nThanks\nAndre\n---\n\ndiff --git a/patch-delta.c b/patch-delta.c\nindex 56e0a5e..cff4d79 100644\n--- a/patch-delta.c\n+++ b/patch-delta.c\n@@ -28,8 +28,10 @@ void *patch_delta(const void *src_buf, unsigned long src_size,\n \n \t/* make sure the orig file size matches what we expect */\n \tsize = get_delta_hdr_size(&data, top);\n-\tif (size != src_size)\n+\tif (size != src_size) {\n+\t\terror(\"bad delta header size, expected: %lu, have %lu\", src_size, size);\n \t\treturn NULL;\n+\t}\n \n \t/* now the result size */\n \tsize = get_delta_hdr_size(&data, top);\n-- \nThe only person who always got his work done by Friday was Robinson Crusoe\n"}]}