Skip to content

Commit 7046e75

Browse files
committed
Merge branch 'ar/clone-honor-umask-at-top' into maint
A handful of files and directories we create had tighter than necessary permission bits when the user wanted to have group writability (e.g. by setting "umask 002"). * ar/clone-honor-umask-at-top: add: create ADD_EDIT.patch with mode 0666 rerere: make rr-cache fanout directory honor umask Restore umasks influence on the permissions of work tree created by clone
2 parents c9603df + 6ff2b72 commit 7046e75

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

builtin/add.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
281281
argc = setup_revisions(argc, argv, &rev, NULL);
282282
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
283283
DIFF_OPT_SET(&rev.diffopt, IGNORE_DIRTY_SUBMODULES);
284-
out = open(file, O_CREAT | O_WRONLY, 0644);
284+
out = open(file, O_CREAT | O_WRONLY, 0666);
285285
if (out < 0)
286286
die (_("Could not open '%s' for writing."), file);
287287
rev.diffopt.file = xfdopen(out, "w");

builtin/clone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
708708
if (safe_create_leading_directories_const(work_tree) < 0)
709709
die_errno(_("could not create leading directories of '%s'"),
710710
work_tree);
711-
if (!dest_exists && mkdir(work_tree, 0755))
711+
if (!dest_exists && mkdir(work_tree, 0777))
712712
die_errno(_("could not create work tree dir '%s'."),
713713
work_tree);
714714
set_git_work_tree(work_tree);

rerere.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ static int do_plain_rerere(struct string_list *rr, int fd)
524524
continue;
525525
hex = xstrdup(sha1_to_hex(sha1));
526526
string_list_insert(rr, path)->util = hex;
527-
if (mkdir(git_path("rr-cache/%s", hex), 0755))
527+
if (mkdir_in_gitdir(git_path("rr-cache/%s", hex)))
528528
continue;
529529
handle_file(path, NULL, rerere_path(hex, "preimage"));
530530
fprintf(stderr, "Recorded preimage for '%s'\n", path);

0 commit comments

Comments
 (0)