Skip to content

Commit

Permalink
Honor extractor's umask in git-tar-tree.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Oct 2, 2005
1 parent f8d839a commit 38ec15a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tar-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ static void traverse_tree(void *buffer, unsigned long size,

if (size < namelen + 20 || sscanf(buffer, "%o", &mode) != 1)
die("corrupt 'tree' file");
if (S_ISDIR(mode) || S_ISREG(mode))
mode |= (mode & 0100) ? 0777 : 0666;
buffer = sha1 + 20;
size -= namelen + 20;

Expand Down

0 comments on commit 38ec15a

Please sign in to comment.