@@ -566,7 +566,7 @@ static int verify_ordered(unsigned mode1, const char *name1, unsigned mode2, con
566
566
return c1 < c2 ? 0 : TREE_UNORDERED ;
567
567
}
568
568
569
- static int fsck_tree (struct tree * item ,
569
+ static int fsck_tree (const struct object_id * oid ,
570
570
const char * buffer , unsigned long size ,
571
571
struct fsck_options * options )
572
572
{
@@ -586,7 +586,7 @@ static int fsck_tree(struct tree *item,
586
586
const char * o_name ;
587
587
588
588
if (init_tree_desc_gently (& desc , buffer , size )) {
589
- retval += report (options , & item -> object . oid , item -> object . type , FSCK_MSG_BAD_TREE , "cannot be parsed as a tree" );
589
+ retval += report (options , oid , OBJ_TREE , FSCK_MSG_BAD_TREE , "cannot be parsed as a tree" );
590
590
return retval ;
591
591
}
592
592
@@ -613,13 +613,13 @@ static int fsck_tree(struct tree *item,
613
613
oidset_insert (& gitmodules_found , oid );
614
614
else
615
615
retval += report (options ,
616
- & item -> object . oid , item -> object . type ,
616
+ oid , OBJ_TREE ,
617
617
FSCK_MSG_GITMODULES_SYMLINK ,
618
618
".gitmodules is a symbolic link" );
619
619
}
620
620
621
621
if (update_tree_entry_gently (& desc )) {
622
- retval += report (options , & item -> object . oid , item -> object . type , FSCK_MSG_BAD_TREE , "cannot be parsed as a tree" );
622
+ retval += report (options , oid , OBJ_TREE , FSCK_MSG_BAD_TREE , "cannot be parsed as a tree" );
623
623
break ;
624
624
}
625
625
@@ -664,25 +664,25 @@ static int fsck_tree(struct tree *item,
664
664
}
665
665
666
666
if (has_null_sha1 )
667
- retval += report (options , & item -> object . oid , item -> object . type , FSCK_MSG_NULL_SHA1 , "contains entries pointing to null sha1" );
667
+ retval += report (options , oid , OBJ_TREE , FSCK_MSG_NULL_SHA1 , "contains entries pointing to null sha1" );
668
668
if (has_full_path )
669
- retval += report (options , & item -> object . oid , item -> object . type , FSCK_MSG_FULL_PATHNAME , "contains full pathnames" );
669
+ retval += report (options , oid , OBJ_TREE , FSCK_MSG_FULL_PATHNAME , "contains full pathnames" );
670
670
if (has_empty_name )
671
- retval += report (options , & item -> object . oid , item -> object . type , FSCK_MSG_EMPTY_NAME , "contains empty pathname" );
671
+ retval += report (options , oid , OBJ_TREE , FSCK_MSG_EMPTY_NAME , "contains empty pathname" );
672
672
if (has_dot )
673
- retval += report (options , & item -> object . oid , item -> object . type , FSCK_MSG_HAS_DOT , "contains '.'" );
673
+ retval += report (options , oid , OBJ_TREE , FSCK_MSG_HAS_DOT , "contains '.'" );
674
674
if (has_dotdot )
675
- retval += report (options , & item -> object . oid , item -> object . type , FSCK_MSG_HAS_DOTDOT , "contains '..'" );
675
+ retval += report (options , oid , OBJ_TREE , FSCK_MSG_HAS_DOTDOT , "contains '..'" );
676
676
if (has_dotgit )
677
- retval += report (options , & item -> object . oid , item -> object . type , FSCK_MSG_HAS_DOTGIT , "contains '.git'" );
677
+ retval += report (options , oid , OBJ_TREE , FSCK_MSG_HAS_DOTGIT , "contains '.git'" );
678
678
if (has_zero_pad )
679
- retval += report (options , & item -> object . oid , item -> object . type , FSCK_MSG_ZERO_PADDED_FILEMODE , "contains zero-padded file modes" );
679
+ retval += report (options , oid , OBJ_TREE , FSCK_MSG_ZERO_PADDED_FILEMODE , "contains zero-padded file modes" );
680
680
if (has_bad_modes )
681
- retval += report (options , & item -> object . oid , item -> object . type , FSCK_MSG_BAD_FILEMODE , "contains bad file modes" );
681
+ retval += report (options , oid , OBJ_TREE , FSCK_MSG_BAD_FILEMODE , "contains bad file modes" );
682
682
if (has_dup_entries )
683
- retval += report (options , & item -> object . oid , item -> object . type , FSCK_MSG_DUPLICATE_ENTRIES , "contains duplicate file entries" );
683
+ retval += report (options , oid , OBJ_TREE , FSCK_MSG_DUPLICATE_ENTRIES , "contains duplicate file entries" );
684
684
if (not_properly_sorted )
685
- retval += report (options , & item -> object . oid , item -> object . type , FSCK_MSG_TREE_NOT_SORTED , "not properly sorted" );
685
+ retval += report (options , oid , OBJ_TREE , FSCK_MSG_TREE_NOT_SORTED , "not properly sorted" );
686
686
return retval ;
687
687
}
688
688
@@ -982,7 +982,7 @@ int fsck_object(struct object *obj, void *data, unsigned long size,
982
982
if (obj -> type == OBJ_BLOB )
983
983
return fsck_blob (& obj -> oid , data , size , options );
984
984
if (obj -> type == OBJ_TREE )
985
- return fsck_tree (( struct tree * ) obj , data , size , options );
985
+ return fsck_tree (& obj -> oid , data , size , options );
986
986
if (obj -> type == OBJ_COMMIT )
987
987
return fsck_commit (& obj -> oid , data , size , options );
988
988
if (obj -> type == OBJ_TAG )
0 commit comments