Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Honor extractor's umask in git-tar-tree.
author
Junio C Hamano
<junkio@cox.net>
Sat, 1 Oct 2005 19:01:07 +0000
(12:01 -0700)
committer
Junio C Hamano
<junkio@cox.net>
Sun, 2 Oct 2005 06:14:06 +0000
(23:14 -0700)
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>
tar-tree.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
f8d839a
)
diff --git
a/tar-tree.c
b/tar-tree.c
index 2716ae3eb1430abfc43d980d904fc192f8dcbbf4..970c4bb54e148282a89f1249a96deca880bccafd 100644
(file)
--- a/
tar-tree.c
+++ b/
tar-tree.c
@@
-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 (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;
buffer = sha1 + 20;
size -= namelen + 20;