@@ -488,7 +488,7 @@ int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info)
488488struct dir_state {
489489 void * tree ;
490490 unsigned long size ;
491- unsigned char sha1 [ 20 ] ;
491+ struct object_id oid ;
492492};
493493
494494static int find_tree_entry (struct tree_desc * t , const char * name , struct object_id * result , unsigned * mode )
@@ -576,7 +576,7 @@ int get_tree_entry(const struct object_id *tree_oid, const char *name, struct ob
576576 * See the code for enum follow_symlink_result for a description of
577577 * the return values.
578578 */
579- enum follow_symlinks_result get_tree_entry_follow_symlinks (unsigned char * tree_sha1 , const char * name , unsigned char * result , struct strbuf * result_path , unsigned * mode )
579+ enum follow_symlinks_result get_tree_entry_follow_symlinks (struct object_id * tree_oid , const char * name , struct object_id * result , struct strbuf * result_path , unsigned * mode )
580580{
581581 int retval = MISSING_OBJECT ;
582582 struct dir_state * parents = NULL ;
@@ -589,7 +589,7 @@ enum follow_symlinks_result get_tree_entry_follow_symlinks(unsigned char *tree_s
589589
590590 init_tree_desc (& t , NULL , 0UL );
591591 strbuf_addstr (& namebuf , name );
592- hashcpy ( current_tree_oid . hash , tree_sha1 );
592+ oidcpy ( & current_tree_oid , tree_oid );
593593
594594 while (1 ) {
595595 int find_result ;
@@ -609,11 +609,11 @@ enum follow_symlinks_result get_tree_entry_follow_symlinks(unsigned char *tree_s
609609 ALLOC_GROW (parents , parents_nr + 1 , parents_alloc );
610610 parents [parents_nr ].tree = tree ;
611611 parents [parents_nr ].size = size ;
612- hashcpy ( parents [parents_nr ].sha1 , root . hash );
612+ oidcpy ( & parents [parents_nr ].oid , & root );
613613 parents_nr ++ ;
614614
615615 if (namebuf .buf [0 ] == '\0' ) {
616- hashcpy (result , root . hash );
616+ oidcpy (result , & root );
617617 retval = FOUND ;
618618 goto done ;
619619 }
@@ -663,7 +663,7 @@ enum follow_symlinks_result get_tree_entry_follow_symlinks(unsigned char *tree_s
663663
664664 /* We could end up here via a symlink to dir/.. */
665665 if (namebuf .buf [0 ] == '\0' ) {
666- hashcpy (result , parents [parents_nr - 1 ].sha1 );
666+ oidcpy (result , & parents [parents_nr - 1 ].oid );
667667 retval = FOUND ;
668668 goto done ;
669669 }
@@ -677,7 +677,7 @@ enum follow_symlinks_result get_tree_entry_follow_symlinks(unsigned char *tree_s
677677
678678 if (S_ISDIR (* mode )) {
679679 if (!remainder ) {
680- hashcpy (result , current_tree_oid . hash );
680+ oidcpy (result , & current_tree_oid );
681681 retval = FOUND ;
682682 goto done ;
683683 }
@@ -687,7 +687,7 @@ enum follow_symlinks_result get_tree_entry_follow_symlinks(unsigned char *tree_s
687687 1 + first_slash - namebuf .buf );
688688 } else if (S_ISREG (* mode )) {
689689 if (!remainder ) {
690- hashcpy (result , current_tree_oid . hash );
690+ oidcpy (result , & current_tree_oid );
691691 retval = FOUND ;
692692 } else {
693693 retval = NOT_DIR ;
0 commit comments