)]}'
{
  "commit": "98fa0d50a75099df3f2d62f9181e4c1bbf70f063",
  "tree": "44ca79a4ad52cd7029e8caca95ecf29f8895570f",
  "parents": [
    "3d2ac2065e2ac230c92cb87cc46053a0f3db1616"
  ],
  "author": {
    "name": "Taylor Blau",
    "email": "me@ttaylorr.com",
    "time": "Wed Oct 15 18:29:21 2025 -0400"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Thu Oct 16 10:08:56 2025 -0700"
  },
  "message": "repack: move `find_pack_prefix()` out of the builtin\n\nBoth callers within the repack builtin which call functions that take a\n\u0027write_pack_opts\u0027 structure have the following pattern:\n\n    struct write_pack_opts opts \u003d {\n        .packdir \u003d packdir,\n        .packtmp \u003d packtmp,\n        .pack_prefix \u003d find_pack_prefix(packdir, packtmp),\n        /* ... */\n    };\n    int ret \u003d write_some_kind_of_pack(\u0026opts, /* ... */);\n\n, but both \"packdir\" and \"packtmp\" are fields within the write_pack_opts\nstruct itself!\n\nInstead of also computing the pack_prefix ahead of time, let\u0027s have the\ncallees compute it themselves by moving `find_pack_prefix()` out of the\nrepack builtin, and have it take a write_pack_opts pointer instead of\nthe \"packdir\" and \"packtmp\" fields directly.\n\nThis avoids the callers having to do some prep work that is common\nbetween the two of them, but also avoids the potential pitfall of\naccidentally writing:\n\n    .pack_prefix \u003d find_pack_prefix(packtmp, packdir),\n\n(which is well-typed) when the caller meant to instead write:\n\n    .pack_prefix \u003d find_pack_prefix(packdir, packtmp),\n\nSigned-off-by: Taylor Blau \u003cme@ttaylorr.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7295135ec214fb5122d97c4d8c6247f7c525a7d8",
      "old_mode": 33188,
      "old_path": "builtin/repack.c",
      "new_id": "b21799c650e0e3301080ceb4a5a58b5d9469a25c",
      "new_mode": 33188,
      "new_path": "builtin/repack.c"
    },
    {
      "type": "modify",
      "old_id": "1d485e01124e923d2a211691989c7e806039cedd",
      "old_mode": 33188,
      "old_path": "repack.c",
      "new_id": "19fd1d6d5ba96a73d0071a245bded2888b77bb79",
      "new_mode": 33188,
      "new_path": "repack.c"
    },
    {
      "type": "modify",
      "old_id": "6ef503f62376c5eb413212b7f29708f0d36ef07b",
      "old_mode": 33188,
      "old_path": "repack.h",
      "new_id": "5852e2407f8da5331cf2be3b05d3f12055f4e949",
      "new_mode": 33188,
      "new_path": "repack.h"
    }
  ]
}
