)]}'
{
  "commit": "273c61496f88c6495b886acb1041fe57965151da",
  "tree": "3e4faa8d413bdc0589b69562b09ed09e2cb9a882",
  "parents": [
    "f6adec4e329ef0e25e14c63b735a5956dc67b8bc"
  ],
  "author": {
    "name": "Jeff King",
    "email": "peff@peff.net",
    "time": "Mon Sep 24 04:39:55 2018 -0400"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Thu Sep 27 09:34:59 2018 -0700"
  },
  "message": "submodule-config: ban submodule paths that start with a dash\n\nWe recently banned submodule urls that look like\ncommand-line options. This is the matching change to ban\nleading-dash paths.\n\nAs with the urls, this should not break any use cases that\ncurrently work. Even with our \"--\" separator passed to\ngit-clone, git-submodule.sh gets confused. Without the code\nportion of this patch, the clone of \"-sub\" added in t7417\nwould yield results like:\n\n    /path/to/git-submodule: 410: cd: Illegal option -s\n    /path/to/git-submodule: 417: cd: Illegal option -s\n    /path/to/git-submodule: 410: cd: Illegal option -s\n    /path/to/git-submodule: 417: cd: Illegal option -s\n    Fetched in submodule path \u0027-sub\u0027, but it did not contain b56243f8f4eb91b2f1f8109452e659f14dd3fbe4. Direct fetching of that commit failed.\n\nMoreover, naively adding such a submodule doesn\u0027t work:\n\n  $ git submodule add $url -sub\n  The following path is ignored by one of your .gitignore files:\n  -sub\n\neven though there is no such ignore pattern (the test script\nhacks around this with a well-placed \"git mv\").\n\nUnlike leading-dash urls, though, it\u0027s possible that such a\npath _could_ be useful if we eventually made it work. So\nthis commit should be seen not as recommending a particular\npolicy, but rather temporarily closing off a broken and\npossibly dangerous code-path. We may revisit this decision\nlater.\n\nThere are two minor differences to the tests in t7416 (that\ncovered urls):\n\n  1. We don\u0027t have a \"./-sub\" escape hatch to make this\n     work, since the submodule code expects to be able to\n     match canonical index names to the path field (so you\n     are free to add submodule config with that path, but we\n     would never actually use it, since an index entry would\n     never start with \"./\").\n\n  2. After this patch, cloning actually succeeds. Since we\n     ignore the submodule.*.path value, we fail to find a\n     config stanza for our submodule at all, and simply\n     treat it as inactive. We still check for the \"ignoring\"\n     message.\n\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": "6eb13a5536d31b7b29bd906fa5d9ae3f1ee1c2af",
      "old_mode": 33188,
      "old_path": "submodule-config.c",
      "new_id": "774fb105440a431d741124278987151ac2ea9166",
      "new_mode": 33188,
      "new_path": "submodule-config.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "638293f0dab1c69b2f984b69a8bf96a9c2c98de8",
      "new_mode": 33261,
      "new_path": "t/t7417-submodule-path-url.sh"
    }
  ]
}
