Honor extractor's umask in git-tar-tree.
The archive generated with git-tar-tree had 0755 and 0644 mode bits. This inconvenienced the extractor with umask 002 by robbing g+w bit unconditionally. Just write it out with loose permissions bits and let the umask of the extractor do its job. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Oct 1, 2005 at 12:01 UTC
38ec15a973a1f075f0d94d130b0ef279562921cd
1 file changed
+2
tar-tree.c
+2
@@ -353,6 +353,8 @@ static void traverse_tree(void *buffer, unsigned long size,
353
354
if (size < namelen + 20 || sscanf(buffer, "%o", &mode) != 1)
355
die("corrupt 'tree' file");
356
+ if (S_ISDIR(mode) || S_ISREG(mode))
357
+ mode |= (mode & 0100) ? 0777 : 0666;
358
buffer = sha1 + 20;
359
size -= namelen + 20;
360