)]}'
{
  "commit": "ab5af825db8beaf623f8ac95e4b4179ec1b9569e",
  "tree": "ddb45cb5e931b8936092c75a8b668077e5e0d565",
  "parents": [
    "0e94f7aa730b108f7907cfab1b2a7fba965de442"
  ],
  "author": {
    "name": "Nguyễn Thái Ngọc Duy",
    "email": "pclouds@gmail.com",
    "time": "Mon Mar 18 18:38:22 2019 +0700"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Thu Mar 21 12:06:28 2019 +0900"
  },
  "message": "unpack-trees: fix oneway_merge accidentally carry over stage index\n\nPhillip found out that \u0027git checkout -f \u003cbranch\u003e\u0027 does not restore\nconflict/unmerged files correctly. All tracked files should be taken\nfrom \u003cbranch\u003e and all non-zero stages removed. Most of this is true,\nexcept that the final file could be in stage one instead of zero.\n\n\"checkout -f\" (among other commands) does this with one-way merge, which\nis supposed to take stat info from the index and everything else from\nthe given tree. The add_entry(.., old, ...) call in oneway_merge()\nthough will keep stage index from the index.\n\nThis is normally not a problem if the entry from the index is\nnormal (stage #0). But if there is a conflict, stage #0 does not exist\nand we\u0027ll get stage #1 entry as \"old\" variable, which gets recorded in\nthe final index. Fix it by clearing stage mask.\n\nThis bug probably comes from b5b425074e (git-read-tree: make one-way\nmerge also honor the \"update\" flag, 2005-06-07). Before this commit, we\nmay create the final (\"dst\") index entry from the one in index, but we\ndo clear CE_STAGEMASK.\n\nI briefly checked two- and three-way merge functions. I think we don\u0027t\nhave the same problem in those.\n\nReported-by: Phillip Wood \u003cphillip.wood@dunelm.org.uk\u003e\nSigned-off-by: Nguyễn Thái Ngọc Duy \u003cpclouds@gmail.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7e189851348d571b2e654325ba38e7564d0bc950",
      "old_mode": 33261,
      "old_path": "t/t2023-checkout-m.sh",
      "new_id": "fca3f858245781229ea29b4baeb86e356f50a571",
      "new_mode": 33261,
      "new_path": "t/t2023-checkout-m.sh"
    },
    {
      "type": "modify",
      "old_id": "22c41a3ba80971e5edc6bbf02eb6ea59d3c41277",
      "old_mode": 33188,
      "old_path": "unpack-trees.c",
      "new_id": "1ccd343cad92dfad3e66deb304811eaf7af9b4fc",
      "new_mode": 33188,
      "new_path": "unpack-trees.c"
    }
  ]
}
