)]}'
{
  "commit": "d87de311ff506599ec130ba5f09a4f73e458a5ae",
  "tree": "c6a3545918d7b7a3b3acb9c945f49bafab7f8f29",
  "parents": [
    "aae4ebc895272dc7e5a9ccfc135878b55c7322d7"
  ],
  "author": {
    "name": "Patrick Steinhardt",
    "email": "ps@pks.im",
    "time": "Thu Jun 04 09:46:30 2026 +0200"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Fri Jun 05 21:49:38 2026 +0900"
  },
  "message": "setup: stop initializing object database without repository\n\nThe function `setup_git_directory_gently()` is responsible for\ndiscovering and setting up a Git repository based on various environment\nvariables and the current working directory. The result is thus a fully\nusable Git repository.\n\nOne oddity of this function is that we may set up the object database\neven in the case where we don\u0027t have a repository, namely in the case\nwhere the `GIT_DIR_EXPLICIT` environment variable is set but points to a\nnon-existent repository. If so, we call `setup_git_env_internal()` with\nthe value of the environment variable so that the repository\u0027s Git\ndirectory is configured, even if it points to a non-existent directory.\n\nHistorically though, this function didn\u0027t only configure the repository,\nbut also initialized the object database. We retained this behaviour\nfrom a preceding commit, even though it really doesn\u0027t make much sense\nin the first place -- there is no repository, so we don\u0027t have an object\ndatabase either. There seemingly isn\u0027t much of a reason to construct the\nobject database, as we typically won\u0027t try to read objects when we don\u0027t\nhave an object database.\n\nThere\u0027s one exception though: git-index-pack(1) may run outside of a\nrepository, which can be used to perform consistency checks for a\npackfile. The code path is _almost_ working: we already know to call\n`parse_object_buffer()`, which can read objects without an object\ndatabase being available. And that works for all object types except for\ncommits, because `parse_commit_buffer()` calls `parse_commit_graph()`,\nand that function doesn\u0027t handle the case where we don\u0027t have an object\ndatabase.\n\nFix this instance to check for the object database instead of checking\nfor the Git directory having been initialized. With this fixed, we can\nnow stop constructing an object database completely.\n\nSigned-off-by: Patrick Steinhardt \u003cps@pks.im\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9abe62bd5a278af0af4838c6da75d32a82aafce1",
      "old_mode": 33188,
      "old_path": "commit-graph.c",
      "new_id": "0820cf5fb83cbe3b640e60b0893f80a5076da523",
      "new_mode": 33188,
      "new_path": "commit-graph.c"
    },
    {
      "type": "modify",
      "old_id": "0dc9fe4565a182d2be712b295f7104fcd08a99fd",
      "old_mode": 33188,
      "old_path": "setup.c",
      "new_id": "4a8d6230b18529b4881a7b7a6d4a49b6ef3de7a7",
      "new_mode": 33188,
      "new_path": "setup.c"
    }
  ]
}
