)]}'
{
  "commit": "4468d4435c44d50723e96e3416f8b5da97a1806f",
  "tree": "424963d84268e66dc4cee0679761a90d31e23267",
  "parents": [
    "98cdfbb84ad2ed6a2eb43dafa357a70a4b0a0fad"
  ],
  "author": {
    "name": "SZEDER Gábor",
    "email": "szeder.dev@gmail.com",
    "time": "Sun Jan 27 14:08:32 2019 +0100"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Sun Jan 27 16:55:57 2019 -0800"
  },
  "message": "object_as_type: initialize commit-graph-related fields of \u0027struct commit\u0027\n\nWhen the commit graph and generation numbers were introduced in\ncommits 177722b344 (commit: integrate commit graph with commit\nparsing, 2018-04-10) and 83073cc994 (commit: add generation number to\nstruct commit, 2018-04-25), they tried to make sure that the\ncorresponding \u0027graph_pos\u0027 and \u0027generation\u0027 fields of \u0027struct commit\u0027\nare initialized conservatively, as if the commit were not included in\nthe commit-graph file.\n\nAlas, initializing those fields only in alloc_commit_node() missed the\ncase when an object that happens to be a commit is first looked up via\nlookup_unknown_object(), and is then later converted to a \u0027struct\ncommit\u0027 via the object_as_type() helper function (either calling it\ndirectly, or as part of a subsequent lookup_commit() call).\nConsequently, both of those fields incorrectly remain set to zero,\nwhich means e.g. that the commit is present in and is the first entry\nof the commit-graph file.  This will result in wrong timestamp, parent\nand root tree hashes, if such a \u0027struct commit\u0027 instance is later\nfilled from the commit-graph.\n\nExtract the initialization of \u0027struct commit\u0027s fields from\nalloc_commit_node() into a helper function, and call it from\nobject_as_type() as well, to make sure that it properly initializes\nthe two commit-graph-related fields, too.  With this helper function\nit is hopefully less likely that any new fields added to \u0027struct\ncommit\u0027 in the future would remain uninitialized.\n\nWith this change alloc_commit_index() won\u0027t have any remaining callers\noutside of \u0027alloc.c\u0027, so mark it as static.\n\nSigned-off-by: SZEDER Gábor \u003cszeder.dev@gmail.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e7aa81b7aa48c14f2a98894eb6e8c2e28998945e",
      "old_mode": 33188,
      "old_path": "alloc.c",
      "new_id": "1c64c4dd1629c63a8bb2fff6e580ee0c648a0730",
      "new_mode": 33188,
      "new_path": "alloc.c"
    },
    {
      "type": "modify",
      "old_id": "ba356ed8478d13f05f49efd5bacccaac3e69dfd7",
      "old_mode": 33188,
      "old_path": "alloc.h",
      "new_id": "ed1071c11ea3a6d0f7d55da46df4acf524a32565",
      "new_mode": 33188,
      "new_path": "alloc.h"
    },
    {
      "type": "modify",
      "old_id": "51c45945156c421ada403139faefdf145918f4f7",
      "old_mode": 33188,
      "old_path": "object.c",
      "new_id": "675cb8902b0c7289397f3a51e71b1ca2ce3dd2b6",
      "new_mode": 33188,
      "new_path": "object.c"
    }
  ]
}
