Skip to content

Commit 6ff2b72

Browse files
peffgitster
authored andcommitted
add: create ADD_EDIT.patch with mode 0666
We should be letting the user's umask take care of restricting permissions. Even though this is a temporary file and probably nobody would notice, this brings us in line with other temporary file creations in git (e.g., choosing "e"dit from git-add--interactive). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fd95633 commit 6ff2b72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
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");

0 commit comments

Comments
 (0)