)]}'
{
  "commit": "515be8338237c1f0f98ff826ba98f50d1dff5517",
  "tree": "bdfb93d4b514b692a4e54a2b308e6ca905e42b9c",
  "parents": [
    "3e42cb3b67bef525d4bd8416d44ac1f1a1f7a495"
  ],
  "author": {
    "name": "SZEDER Gábor",
    "email": "szeder.dev@gmail.com",
    "time": "Wed Nov 14 11:46:19 2018 +0100"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Fri Nov 16 13:15:17 2018 +0900"
  },
  "message": "clone: respect additional configured fetch refspecs during initial fetch\n\nThe initial fetch during a clone doesn\u0027t transfer refs matching\nadditional fetch refspecs given on the command line as configuration\nvariables, e.g. \u0027-c remote.origin.fetch\u003d\u003crefspec\u003e\u0027.  This contradicts\nthe documentation stating that configuration variables specified via\n\u0027git clone -c \u003ckey\u003e\u003d\u003cvalue\u003e ...\u0027 \"take effect immediately after the\nrepository is initialized, but before the remote history is fetched\"\nand the given example specifically mentions \"adding additional fetch\nrefspecs to the origin remote\".  Furthermore, one-shot configuration\nvariables specified via \u0027git -c \u003ckey\u003e\u003d\u003cvalue\u003e clone ...\u0027, though not\nwritten to the newly created repository\u0027s config file, live during the\nlifetime of the \u0027clone\u0027 command, including the initial fetch.  All\nthis implies that any fetch refspecs specified this way should already\nbe taken into account during the initial fetch.\n\nThe reason for this is that the initial fetch is not a fully fledged\n\u0027git fetch\u0027 but a bunch of direct calls into the fetch/transport\nmachinery with clone\u0027s own refs-to-refspec matching logic, which\nbypasses parts of \u0027git fetch\u0027 processing configured fetch refspecs.\nThis logic only considers a single default refspec, potentially\ninfluenced by options like \u0027--single-branch\u0027 and \u0027--mirror\u0027.  The\nconfigured refspecs are, however, already read and parsed properly\nwhen clone calls remote.c:remote_get(), but it never looks at the\nparsed refspecs in the resulting \u0027struct remote\u0027.\n\nModify clone to take the remote\u0027s configured fetch refspecs into\naccount to retrieve all matching refs during the initial fetch.  Note\nthat we have to explicitly add the default fetch refspec to the\nremote\u0027s refspecs, because at that point the remote only includes the\nfetch refspecs specified on the command line.\n\nAdd tests to check that refspecs given both via \u0027git clone -c ...\u0027 and\n\u0027git -c ... clone\u0027 retrieve all refs matching either the default or\nthe additional refspecs, and that it works even when the user\nspecifies an alternative remote name via \u0027--origin\u003d\u003cname\u003e\u0027.\n\nSigned-off-by: SZEDER Gábor \u003cszeder.dev@gmail.com\u003e\nReviewed-by: Jeff King \u003cpeff@peff.net\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "290ddc2e5a58ff9f2f846f934ce8442573d9090d",
      "old_mode": 33188,
      "old_path": "builtin/clone.c",
      "new_id": "c9c840eaf8b544505db9a69688674942233f6a42",
      "new_mode": 33188,
      "new_path": "builtin/clone.c"
    },
    {
      "type": "modify",
      "old_id": "39329eb7a8a64b177794b83ef8828b866fead547",
      "old_mode": 33261,
      "old_path": "t/t5611-clone-config.sh",
      "new_id": "60c1ba951b7d4178708574d10986659749925059",
      "new_mode": 33261,
      "new_path": "t/t5611-clone-config.sh"
    }
  ]
}
