{"thread":{"id":"37270","subject":"[BUG] Assertion failed: (child->real_type == OBJ_REF_DELTA), function find_unresolved_deltas_1, file builtin/index-pack.c","startedAt":"2014-08-01T12:24:27Z","lastAt":"2014-08-01T12:24:27Z","messageCount":1,"participants":["Martin von Gagern"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"247100","messageId":"53DB86FB.9080204@gmx.net","threadId":"37270","inReplyTo":null,"subject":"[BUG] Assertion failed: (child->real_type == OBJ_REF_DELTA), function find_unresolved_deltas_1, file builtin/index-pack.c","fromName":"Martin von Gagern","fromEmail":"martin.vgagern@gmx.net","sentAt":"2014-08-01T12:24:27Z","receivedAt":"2014-08-01T12:24:27Z","isPatch":false,"sender":{"key":"martin.vgagern@gmx.net","avatar":"https://avatars.githubusercontent.com/u/190759?v=4"},"body":"Hi!\n\nSee also https://code.google.com/p/support/issues/detail?id=31571\n\nExecuting the command\n\ngit clone https://code.google.com/p/mapsforge/\n\nfails with the error message\n\nAssertion failed: (child->real_type == OBJ_REF_DELTA),\nfunction find_unresolved_deltas_1, file builtin/index-pack.c\n\nBisecting the code I found that 7218a215efc7ae46f7ca8d82 (from 2011,\nfirst released in git 1.7.7) is the first bad commit. It is also the one\nto introduce that assertion.\n\nThe idea behind that commit seems simple: instead of just sorting by\nbase hash, also sort by type. Then when iterating over the matching\nobjects, we can rely on the type and don't have to check that.\n\nSo far, so good. But the problem here is that the sorting is based on\nthe \"type\" attribute, while the assertion and the case distinction it\nreplaces was based on \"real_type\". I guess that at the point where the\nsorting takes place, these two should be identical. But once\nresolve_delta gets called, the real_type is changed to that of the base\nobject. Which means that the original case distinction did more than\njust drop deltas of the wrong type: it also prevented resolution of\nalready-resolved deltas. Therefore the change caused stuff to fail which\nused to work before. In this particular instance, the real_type changed\nfrom OBJ_REF_DELTA to OBJ_TREE which caused the assertion to fail.\n\nI'm not sure whether this kind of duplicate resolution is something\nnormal or indicates some breakage in the repository in question. If it\nis considered normal (although rare, otherwise others would have\ncomplained by now), then someone should likely turn the assertion back\ninto a normal conditional. If this is a broken repository, then I think\nit should be reported as such, since in my book a failed assertion\nindicates a problem with the program itself, not its input data.\n\nThank you very much,\n Martin von Gagern\n\n"}]}