)]}'
{
  "commit": "1d9a66493be9fef38e531da587dd47f6f17ea483",
  "tree": "9d2fcd934624849972667e8c0b29a2a9a8de2162",
  "parents": [
    "2cc8c17d67265f1912b79f8e57fc2718597ca686"
  ],
  "author": {
    "name": "Mark Mentovai",
    "email": "mark@chromium.org",
    "time": "Fri May 23 23:40:46 2025 -0400"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Tue May 27 06:48:07 2025 -0700"
  },
  "message": "apply: set file mode when --reverse creates a deleted file\n\nCommit 01aff0a (apply: correctly reverse patch\u0027s pre- and post-image\nmode bits, 2023-12-26) revised reverse_patches() to maintain the desired\nproperty that when only one of patch::old_mode and patch::new_mode is\nset, the mode will be carried in old_mode. That property is generally\ncorrect, with one notable exception: when creating a file, only new_mode\nwill be set. Since reversing a deletion results in a creation, new_mode\nmust be set in that case.\n\nOmitting handling for this case means that reversing a patch that\nremoves an executable file will not result in the executable permission\nbeing set on the re-created file. Existing test coverage for file modes\nfocuses only on mode changes of existing files.\n\nSwap old_mode and new_mode in reverse_patches() for what\u0027s represented\nin the patch as a file deletion, as it is transformed into a file\ncreation under reversal. This causes git apply --reverse to set the\nexecutable permission properly when re-creating a deleted executable\nfile.\n\nAdd tests ensuring that git apply sets file modes correctly on file\ncreation, both in the forward and reverse directions.\n\nSigned-off-by: Mark Mentovai \u003cmark@chromium.org\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "381d2e3652f4e0e0453b5a78fb22e0e539e46963",
      "old_mode": 33188,
      "old_path": "apply.c",
      "new_id": "8bbe6ed224032e5f5e0cfacef8c5d0626fd77459",
      "new_mode": 33188,
      "new_path": "apply.c"
    },
    {
      "type": "modify",
      "old_id": "bf4e7609dc335b5b523b12b961a6ad770c0317ea",
      "old_mode": 33261,
      "old_path": "t/t4129-apply-samemode.sh",
      "new_id": "1d6317bd7141e0bc802b2078dfb0c2a2fe19d069",
      "new_mode": 33261,
      "new_path": "t/t4129-apply-samemode.sh"
    }
  ]
}
