aboutsummaryrefslogtreecommitdiff
path: root/fsck-cache.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-05 16:18:48 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-05 16:18:48 -0700
commit42ea9cb286423c949d42ad33823a5221182f84bf (patch)
tree599757cc3e6a2bf3ab29d22246662460c1537393 /fsck-cache.c
parentd5a72fd622ecedaea272cd6292abb7138a49e460 (diff)
downloadgit-42ea9cb286423c949d42ad33823a5221182f84bf.tar.gz
git-42ea9cb286423c949d42ad33823a5221182f84bf.tar.xz
Be more careful about tree entry modes.
The tree object parsing used to get the executable bit wrong, and didn't know about symlinks. Also, fsck really wants the full mode value so that it can verify the other bits for sanity, so save it all in struct tree_entry.
Diffstat (limited to 'fsck-cache.c')
-rw-r--r--fsck-cache.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/fsck-cache.c b/fsck-cache.c
index 301cc67b7..abdec92ff 100644
--- a/fsck-cache.c
+++ b/fsck-cache.c
@@ -100,6 +100,28 @@ static int fsck_tree(struct tree *item)
if (strchr(entry->name, '/'))
has_full_path = 1;
+ switch (entry->mode) {
+ /*
+ * Standard modes..
+ */
+ case S_IFREG | 0755:
+ case S_IFREG | 0644:
+ case S_IFLNK:
+ case S_IFDIR:
+ break;
+ /*
+ * This is nonstandard, but we had a few of these
+ * early on when we honored the full set of mode
+ * bits..
+ */
+ case S_IFREG | 0664:
+ break;
+ default:
+ printf("tree %s has entry %o %s\n",
+ sha1_to_hex(item->object.sha1),
+ entry->mode, entry->name);
+ }
+
if (last) {
if (verify_ordered(last, entry) < 0) {
fprintf(stderr, "tree %s not ordered\n",