)]}'
{
  "commit": "eb3c027e1779d0d1b5bd3b4e96a108461c9759a5",
  "tree": "31443e01cff697ad2ff0ec3e39f353bd3b4a7e9c",
  "parents": [
    "898f80736c75878acc02dc55672317fcc0e0a5a6"
  ],
  "author": {
    "name": "Matheus Tavares",
    "email": "matheus.bernardino@usp.br",
    "time": "Tue Dec 01 20:45:04 2020 -0300"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Wed Dec 02 14:35:51 2020 -0800"
  },
  "message": "apply: don\u0027t use core.sharedRepository to create working tree files\n\ncore.sharedRepository defines which permissions Git should set when\ncreating files in $GIT_DIR, so that the repository may be shared with\nother users. But (in its current form) the setting shouldn\u0027t affect how\nfiles are created in the working tree. This is not respected by apply\nand am (which uses apply), when creating leading directories:\n\n$ cat d.patch\n diff --git a/d/f b/d/f\n new file mode 100644\n index 0000000..e69de29\n\nApply without the setting:\n$ umask 0077\n$ git apply d.patch\n$ ls -ld d\n drwx------\n\nApply with the setting:\n$ umask 0077\n$ git -c core.sharedRepository\u003d0770 apply d.patch\n$ ls -ld d\n drwxrws---\n\nOnly the leading directories are affected. That\u0027s because they are\ncreated with safe_create_leading_directories(), which calls\nadjust_shared_perm() to set the directories\u0027 permissions based on\ncore.sharedRepository. To fix that, let\u0027s introduce a variant of this\nfunction that ignores the setting, and use it in apply. Also add a\nregression test and a note in the function documentation about the use\nof each variant according to the destination (working tree or git\ndir).\n\nSigned-off-by: Matheus Tavares \u003cmatheus.bernardino@usp.br\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "76dba93c974b3814117e3856d875e7e4381d2f62",
      "old_mode": 33188,
      "old_path": "apply.c",
      "new_id": "023e8da6b9e35a731b502e727bbbd49448e90a5f",
      "new_mode": 33188,
      "new_path": "apply.c"
    },
    {
      "type": "modify",
      "old_id": "c0072d43b1a78101f92df1283f9f34712f4c0265",
      "old_mode": 33188,
      "old_path": "cache.h",
      "new_id": "c161ddc1f06c846837d6e92c92c382180ce3efd5",
      "new_mode": 33188,
      "new_path": "cache.h"
    },
    {
      "type": "modify",
      "old_id": "dd65bd5c681513c1f7c9bf908dc9f8675e24a829",
      "old_mode": 33188,
      "old_path": "sha1-file.c",
      "new_id": "c3c49d2fa5587a86766d82539bb87b298b1e40ed",
      "new_mode": 33188,
      "new_path": "sha1-file.c"
    },
    {
      "type": "modify",
      "old_id": "5cdd76dfa726d32226b1dd625d21d6280125afb7",
      "old_mode": 33261,
      "old_path": "t/t4129-apply-samemode.sh",
      "new_id": "41818d8315f32359b0eabd1cb91684c90c070098",
      "new_mode": 33261,
      "new_path": "t/t4129-apply-samemode.sh"
    },
    {
      "type": "modify",
      "old_id": "8d59b90348ea898ca983e8bbd0742de495a8d36d",
      "old_mode": 33188,
      "old_path": "t/test-lib-functions.sh",
      "new_id": "7195d55c907cc60aacdb14a2ff4d52ba06b54822",
      "new_mode": 33188,
      "new_path": "t/test-lib-functions.sh"
    }
  ]
}
