aboutsummaryrefslogtreecommitdiffstats
path: root/tree.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-27 16:08:43 -0700
committerJunio C Hamano <junkio@cox.net>2005-07-27 18:57:14 -0700
commit64071805eda2b57d2b77943bb3f9865d90562ecf (patch)
treef716258e3fd266b5c917765ba56ae1a6a5a6a8f0 /tree.c
parent4e81304afc529c0caca7c012a155be4e342b52d4 (diff)
downloadgit-64071805eda2b57d2b77943bb3f9865d90562ecf.tar.gz
git-fsck-cache: be stricter about "tree" objects
In particular, warn about things like zero-padding of the mode bits, which is a big no-no, since it makes otherwise identical trees have different representations (and thus different SHA1 numbers). Also make the warnings more regular. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tree.c b/tree.c
index dabc2e7a2c..8f490b8984 100644
--- a/tree.c
+++ b/tree.c
@@ -167,6 +167,7 @@ int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size)
entry->directory = S_ISDIR(mode) != 0;
entry->executable = (mode & S_IXUSR) != 0;
entry->symlink = S_ISLNK(mode) != 0;
+ entry->zeropad = *(char *)bufptr == '0';
entry->mode = mode;
entry->next = NULL;