)]}'
{
  "commit": "1fb2b636c672fea06fdc5f50d5c0ed44117ae45a",
  "tree": "5569c294402e712b73b4e4743d3bc9518a75a3ca",
  "parents": [
    "f9b7573f6b0039d298de826e22c636db79b9c919"
  ],
  "author": {
    "name": "Jeff King",
    "email": "peff@peff.net",
    "time": "Tue Sep 05 09:05:01 2017 -0400"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Wed Sep 06 18:06:26 2017 +0900"
  },
  "message": "set_git_dir: handle feeding gitdir to itself\n\nIdeally we\u0027d free the existing gitdir field before assigning\nthe new one, to avoid a memory leak. But we can\u0027t do so\nsafely because some callers do the equivalent of:\n\n  set_git_dir(get_git_dir());\n\nWe can detect that case as a noop, but there are even more\ncomplicated cases like:\n\n  set_git_dir(remove_leading_path(worktree, get_git_dir());\n\nwhere we really do need to do some work, but the original\nstring must remain valid.\n\nRather than put the burden on callers to make a copy of the\nstring (only to free it later, since we\u0027ll make a copy of it\nourselves), let\u0027s solve the problem inside set_git_dir(). We\ncan make a copy of the pointer for the old gitdir, and then\navoid freeing it until after we\u0027ve made our new copy.\n\nSigned-off-by: Jeff King \u003cpeff@peff.net\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "52f1821c6b4c871c86699add1cc88956424173ea",
      "old_mode": 33188,
      "old_path": "repository.c",
      "new_id": "97c732bd48ca8776203ae0936fe8ee61bb330ad9",
      "new_mode": 33188,
      "new_path": "repository.c"
    },
    {
      "type": "modify",
      "old_id": "23950173fc01268320d2e23c36ef80a1b1231a5e",
      "old_mode": 33188,
      "old_path": "setup.c",
      "new_id": "6d8380acd2b66ee7d8206639d4b03933afb1816e",
      "new_mode": 33188,
      "new_path": "setup.c"
    }
  ]
}
