Merge branch 'jk/commit-buffer-length'
[gitweb.git] / builtin / index-pack.c
index 18f57de58b02de33909a40ea9720e6602cc9dcb5..8b3bd29dbcf22668040c53fffb6e2414ca090f5d 100644 (file)
@@ -786,7 +786,8 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
                        }
                        if (obj->type == OBJ_COMMIT) {
                                struct commit *commit = (struct commit *) obj;
-                               commit->buffer = NULL;
+                               if (detach_commit_buffer(commit, NULL) != data)
+                                       die("BUG: parse_object_buffer transmogrified our buffer");
                        }
                        obj->flags |= FLAG_CHECKED;
                }