)]}'
{
  "commit": "2f79c79bba0da415eed3a8e1b32823b7c388b7f4",
  "tree": "e746dbcddf57c1cdf288f582739ffd3e6672c6a0",
  "parents": [
    "98fa0d50a75099df3f2d62f9181e4c1bbf70f063"
  ],
  "author": {
    "name": "Taylor Blau",
    "email": "me@ttaylorr.com",
    "time": "Wed Oct 15 18:29:24 2025 -0400"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Thu Oct 16 10:08:56 2025 -0700"
  },
  "message": "repack: extract `write_pack_opts_is_local()`\n\nSimilar to the previous commit, the functions `write_cruft_pack()` and\n`write_filtered_pack()` both compute a \"local\" variable via the exact\nsame mechanism:\n\n    const char *scratch;\n    int local \u003d skip_prefix(opts-\u003edestination, opts-\u003epackdir, \u0026scratch);\n\nNot only does this cause us to repeat the same pair of lines, it also\nintroduces an unnecessary \"scratch\" variable that is common between both\nfunctions.\n\nInstead of repeating ourselves, let\u0027s extract that functionality into a\nnew function in the repack.h API called \"write_pack_opts_is_local()\".\nThat function takes a pointer to a \"struct write_pack_opts\" (which has\nas fields both \"destination\" and \"packdir\"), and can encapsulate the\ndangling \"scratch\" field.\n\nExtract that function and make it visible within the repack.h API, and\nuse it within both `write_cruft_pack()` and `write_filtered_pack()`.\nWhile we\u0027re at it, match our modern conventions by returning a \"bool\"\ninstead of \"int\", and use `starts_with()` instead of `skip_prefix()` to\navoid storing the dummy \"scratch\" variable.\n\nThe remaining duplication (that is, that both `write_cruft_pack()` and\n`write_filtered_pack()` still both call `write_pack_opts_is_local()`)\nwill be addressed in the following commit.\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": "b21799c650e0e3301080ceb4a5a58b5d9469a25c",
      "old_mode": 33188,
      "old_path": "builtin/repack.c",
      "new_id": "d1449cfe13717ed823c8031ee8a4d061b4f55758",
      "new_mode": 33188,
      "new_path": "builtin/repack.c"
    },
    {
      "type": "modify",
      "old_id": "19fd1d6d5ba96a73d0071a245bded2888b77bb79",
      "old_mode": 33188,
      "old_path": "repack.c",
      "new_id": "d2ee9f2460f3a3de901a2e88da568cc78cacb8c7",
      "new_mode": 33188,
      "new_path": "repack.c"
    },
    {
      "type": "modify",
      "old_id": "5852e2407f8da5331cf2be3b05d3f12055f4e949",
      "old_mode": 33188,
      "old_path": "repack.h",
      "new_id": "26d1954ae28dddf5036780684db4a689e545504e",
      "new_mode": 33188,
      "new_path": "repack.h"
    }
  ]
}
