)]}'
{
  "commit": "649c768a25b191dbea72c7bacaed5b81ef195bf5",
  "tree": "d173d27e2f507118e0123761f647fb785e9e88f4",
  "parents": [
    "67ad42147a7acc2af6074753ebd03d904476118f"
  ],
  "author": {
    "name": "K Jayatheerth",
    "email": "jayatheerthkulkarni2005@gmail.com",
    "time": "Tue Mar 24 07:27:33 2026 +0530"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Mon Mar 23 21:27:17 2026 -0700"
  },
  "message": "remote-curl: fall back to default hash outside repo\n\nWhen a remote helper like git-remote-http is invoked outside of a\nrepository (for example, by running git ls-remote in a non-git\ndirectory), setup_git_directory_gently() leaves the_hash_algo\nuninitialized as NULL.\n\nIf the user has a globally configured fetch refspec, remote-curl\nattempts to parse it during initialization. Inside parse_refspec(),\nit checks whether the LHS of the refspec is an exact OID by evaluating\nllen \u003d\u003d the_hash_algo-\u003ehexsz. Because the_hash_algo is NULL, this\nresults in a segmentation fault.\n\nIn 9e89dcb66a (builtin/ls-remote: fall back to SHA1 outside of a repo,\n2024-08-02), we added a workaround to ls-remote to fall back to the\ndefault hash algorithm to prevent exactly this type of crash when\nparsing refspec capabilities. However, because remote-curl runs as a\nseparate process, it does not inherit that fallback and crashes anyway.\n\nInstead of pushing a NULL-guard workaround down into parse_refspec(),\nfix this by mirroring the ls-remote workaround directly in\nremote-curl.c. If we are operating outside a repository, initialize\nthe_hash_algo to GIT_HASH_DEFAULT. This keeps the HTTP transport\nconsistent with non-HTTP transports that execute in-process, preventing\ncrashes without altering the generic refspec parsing logic.\n\nReported-by: Jo Liss \u003cjoliss@gmail.com\u003e\nHelped-by: Jeff King \u003cpeff@peff.net\u003e\nSigned-off-by: K Jayatheerth \u003cjayatheerthkulkarni2005@gmail.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "69f919454a4565dd1c7256b5050d33b56ea208ea",
      "old_mode": 33188,
      "old_path": "remote-curl.c",
      "new_id": "a489cbe6f4aff040f1a0322bbc185b290e70b9b7",
      "new_mode": 33188,
      "new_path": "remote-curl.c"
    },
    {
      "type": "modify",
      "old_id": "73cf5315800fa46839631d2ae506046f24f541e2",
      "old_mode": 33261,
      "old_path": "t/t5551-http-fetch-smart.sh",
      "new_id": "a26b6c284401a29c747542d68dfc14d4add10c5b",
      "new_mode": 33261,
      "new_path": "t/t5551-http-fetch-smart.sh"
    }
  ]
}
