)]}'
{
  "commit": "49ca2fba393fa277ab70253337c53c7831597c3a",
  "tree": "c891e1ef48eb007e8723d8e9a781139d31dca8aa",
  "parents": [
    "080bc4990f56f9d0687919e5136cb138509f1269"
  ],
  "author": {
    "name": "Jeff King",
    "email": "peff@peff.net",
    "time": "Thu Sep 08 15:26:09 2022 -0400"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Thu Sep 08 13:10:37 2022 -0700"
  },
  "message": "fetch: add branch.*.merge to default ref-prefix extension\n\nWhen running \"git pull\" with no arguments, we\u0027ll do a default \"git\nfetch\" and then try to merge the branch specified by the branch.*.merge\nconfig. There\u0027s code in get_ref_map() to treat that \"merge\" branch as\nsomething we want to fetch, even if it is not otherwise covered by the\ndefault refspec.\n\nThis works fine with the v0 protocol, as the server tells us about all\nof the refs, and get_ref_map() is the ultimate decider of what we fetch.\n\nBut in the v2 protocol, we send the ref-prefix extension to the server,\nasking it to limit the ref advertisement. And we only tell it about the\ndefault refspec for the remote; we don\u0027t mention the branch.*.merge\nconfig at all.\n\nThis usually doesn\u0027t matter, because the default refspec matches\n\"refs/heads/*\", which covers all branches. But if you explicitly use a\nnarrow refspec, then \"git pull\" on some branches may fail. The server\ndoesn\u0027t advertise the branch, so we don\u0027t fetch it, and \"git pull\"\nthinks that it went away upstream.\n\nWe can fix this by including any branch.*.merge entries for the current\nbranch in the list of ref-prefixes we pass to the server. This only\nneeds to happen when using the default configured refspec (since\ncommand-line refspecs are already added, and take precedence in deciding\nwhat we fetch). We don\u0027t otherwise need to replicate any of the \"what to\nfetch\" logic in get_ref_map(). These ref-prefixes are an optimization,\nso it\u0027s OK if we tell the server to advertise the branch.*.merge ref,\neven if we\u0027re not going to pull it. We\u0027ll just choose not to fetch it.\n\nThe test here is based on one constructed by Johannes. I modified the\nbranch names to trigger the ref-prefix issue (and be more descriptive),\nand to confirm that \"git pull\" actually updated the local ref, which\nshould be more robust than just checking stderr.\n\nReported-by: Lana Deere \u003clana.deere@gmail.com\u003e\nHelped-by: Johannes Schindelin \u003cJohannes.Schindelin@gmx.de\u003e\nSigned-off-by: Jeff King \u003cpeff@peff.net\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d39098d9abf9c2d933f9dee3ccc67826f16683d4",
      "old_mode": 33188,
      "old_path": "builtin/fetch.c",
      "new_id": "acc4e89bc92ccc4955c30a9347f4ab68726cb23f",
      "new_mode": 33188,
      "new_path": "builtin/fetch.c"
    },
    {
      "type": "modify",
      "old_id": "081808009b2e74aa4cb81a768a15701dd4eca9d5",
      "old_mode": 33261,
      "old_path": "t/t5520-pull.sh",
      "new_id": "0b72112fb10759bb1d5e9de912ae1b2038df1d00",
      "new_mode": 33261,
      "new_path": "t/t5520-pull.sh"
    }
  ]
}
