)]}'
{
  "commit": "d2c84dad1c88f40906799bc879f70b965efd8ba6",
  "tree": "0f5ade52bd955bf983830a41972c6307ae6fa8d4",
  "parents": [
    "cc756edda63769cf6d7acc99e6ad3a9cbb5dc3ec"
  ],
  "author": {
    "name": "Johannes Schindelin",
    "email": "johannes.schindelin@gmx.de",
    "time": "Thu Sep 05 13:27:53 2019 +0200"
  },
  "committer": {
    "name": "Johannes Schindelin",
    "email": "johannes.schindelin@gmx.de",
    "time": "Thu Dec 05 15:37:06 2019 +0100"
  },
  "message": "mingw: refuse to access paths with trailing spaces or periods\n\nWhen creating a directory on Windows whose path ends in a space or a\nperiod (or chains thereof), the Win32 API \"helpfully\" trims those. For\nexample, `mkdir(\"abc \");` will return success, but actually create a\ndirectory called `abc` instead.\n\nThis stems back to the DOS days, when all file names had exactly 8\ncharacters plus exactly 3 characters for the file extension, and the\nonly way to have shorter names was by padding with spaces.\n\nSadly, this \"helpful\" behavior is a bit inconsistent: after a successful\n`mkdir(\"abc \");`, a `mkdir(\"abc /def\")` will actually _fail_ (because\nthe directory `abc ` does not actually exist).\n\nEven if it would work, we now have a serious problem because a Git\nrepository could contain directories `abc` and `abc `, and on Windows,\nthey would be \"merged\" unintentionally.\n\nAs these paths are illegal on Windows, anyway, let\u0027s disallow any\naccesses to such paths on that Operating System.\n\nFor practical reasons, this behavior is still guarded by the\nconfig setting `core.protectNTFS`: it is possible (and at least two\nregression tests make use of it) to create commits without involving the\nworktree. In such a scenario, it is of course possible -- even on\nWindows -- to create such file names.\n\nAmong other consequences, this patch disallows submodules\u0027 paths to end\nin spaces on Windows (which would formerly have confused Git enough to\ntry to write into incorrect paths, anyway).\n\nWhile this patch does not fix a vulnerability on its own, it prevents an\nattack vector that was exploited in demonstrations of a number of\nrecently-fixed security bugs.\n\nThe regression test added to `t/t7417-submodule-path-url.sh` reflects\nthat attack vector.\n\nNote that we have to adjust the test case \"prevent git~1 squatting on\nWindows\" in `t/t7415-submodule-names.sh` because of a very subtle issue.\nIt tries to clone two submodules whose names differ only in a trailing\nperiod character, and as a consequence their git directories differ in\nthe same way. Previously, when Git tried to clone the second submodule,\nit thought that the git directory already existed (because on Windows,\nwhen you create a directory with the name `b.` it actually creates `b`),\nbut with this patch, the first submodule\u0027s clone will fail because of\nthe illegal name of the git directory. Therefore, when cloning the\nsecond submodule, Git will take a different code path: a fresh clone\n(without an existing git directory). Both code paths fail to clone the\nsecond submodule, both because the the corresponding worktree directory\nexists and is not empty, but the error messages are worded differently.\n\nSigned-off-by: Johannes Schindelin \u003cjohannes.schindelin@gmx.de\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8b6fa0db446aee9888ff6484560131143c7e22e5",
      "old_mode": 33188,
      "old_path": "compat/mingw.c",
      "new_id": "17b4da16e85cef21a26a3674165e67b78ea95ebe",
      "new_mode": 33188,
      "new_path": "compat/mingw.c"
    },
    {
      "type": "modify",
      "old_id": "e03aecfe2e6556e1ef513922104557373eaa9260",
      "old_mode": 33188,
      "old_path": "compat/mingw.h",
      "new_id": "8c49c1d09b697d009e4dc964bc34cfc5377334d7",
      "new_mode": 33188,
      "new_path": "compat/mingw.h"
    },
    {
      "type": "modify",
      "old_id": "6cb3c2f19eb5a0822ae17a1b1e1abc08d3de25e4",
      "old_mode": 33188,
      "old_path": "git-compat-util.h",
      "new_id": "e587ac4e2365bb790a8c74dd7646b349e1f69c5e",
      "new_mode": 33188,
      "new_path": "git-compat-util.h"
    },
    {
      "type": "modify",
      "old_id": "bde1e70c5142f905c3f98514ec19370412348572",
      "old_mode": 33188,
      "old_path": "read-cache.c",
      "new_id": "771171c4028d0630405fffe3f129fcef55cad20b",
      "new_mode": 33188,
      "new_path": "read-cache.c"
    },
    {
      "type": "modify",
      "old_id": "16d8e689c80029d996d4902e527db736e0559bfc",
      "old_mode": 33188,
      "old_path": "t/helper/test-path-utils.c",
      "new_id": "8b3ce07860d4d5dfeca06041b811282a59ef40bb",
      "new_mode": 33188,
      "new_path": "t/helper/test-path-utils.c"
    },
    {
      "type": "modify",
      "old_id": "2b8589e921cefc09d18c6701c1b4db2c833c8591",
      "old_mode": 33261,
      "old_path": "t/t0060-path-utils.sh",
      "new_id": "1171e0bb8850b97bd3ad0b6e70ce178467e28f65",
      "new_mode": 33261,
      "new_path": "t/t0060-path-utils.sh"
    },
    {
      "type": "modify",
      "old_id": "7c65e7a35c9819411eb1eeb0d8a0e157fae58015",
      "old_mode": 33261,
      "old_path": "t/t7415-submodule-names.sh",
      "new_id": "5141ff45c300c05075b9bd00aeb5c98f2aadca0f",
      "new_mode": 33261,
      "new_path": "t/t7415-submodule-names.sh"
    },
    {
      "type": "modify",
      "old_id": "638293f0dab1c69b2f984b69a8bf96a9c2c98de8",
      "old_mode": 33261,
      "old_path": "t/t7417-submodule-path-url.sh",
      "new_id": "fad9e20dc4cb17bfcfc3b514840bba15c0e83f50",
      "new_mode": 33261,
      "new_path": "t/t7417-submodule-path-url.sh"
    }
  ]
}
