Skip to content

Commit 45d4fdc

Browse files
raalkmlgitster
authored andcommitted
Restore umasks influence on the permissions of work tree created by clone
The original version of the git-clone just used mkdir(1) to create the working directories. The version rewritten in C creates all directories inside the working tree by using the mode argument of 0777 when calling mkdir(2) to let the umask take effect. But the top-level directory of the working tree is created by passing the mode argument of 0755 to mkdir(2), which results in an overly tight restriction if the user wants to make directories group writable with a looser umask like 002. Signed-off-by: Alex Riesen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d0f1ea6 commit 45d4fdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/clone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
557557
if (safe_create_leading_directories_const(work_tree) < 0)
558558
die_errno(_("could not create leading directories of '%s'"),
559559
work_tree);
560-
if (!dest_exists && mkdir(work_tree, 0755))
560+
if (!dest_exists && mkdir(work_tree, 0777))
561561
die_errno(_("could not create work tree dir '%s'."),
562562
work_tree);
563563
set_git_work_tree(work_tree);

0 commit comments

Comments
 (0)