aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-07-10 02:37:22 -0400
committerJunio C Hamano <gitster@pobox.com>2012-07-09 23:47:26 -0700
commit6ff2b729debc07fce5c5c1226f9fee9ea59cd7ab (patch)
tree72ba9b09c5bde5b81a9da79b69464d742937dd5f /builtin
parentfd9563385f34c888408cf4f8683b1745ca2cf77a (diff)
downloadgit-6ff2b729debc07fce5c5c1226f9fee9ea59cd7ab.tar.gz
git-6ff2b729debc07fce5c5c1226f9fee9ea59cd7ab.tar.xz
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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/add.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/add.c b/builtin/add.c
index b79336d71..d0b915143 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -281,7 +281,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
argc = setup_revisions(argc, argv, &rev, NULL);
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
DIFF_OPT_SET(&rev.diffopt, IGNORE_DIRTY_SUBMODULES);
- out = open(file, O_CREAT | O_WRONLY, 0644);
+ out = open(file, O_CREAT | O_WRONLY, 0666);
if (out < 0)
die (_("Could not open '%s' for writing."), file);
rev.diffopt.file = xfdopen(out, "w");