@@ -131,22 +131,22 @@ static void match_trees(const unsigned char *hash1,
131131
132132 while (one .size ) {
133133 const char * path ;
134- const unsigned char * elem ;
134+ const struct object_id * elem ;
135135 unsigned mode ;
136136 int score ;
137137
138138 elem = tree_entry_extract (& one , & path , & mode );
139139 if (!S_ISDIR (mode ))
140140 goto next ;
141- score = score_trees (elem , hash2 );
141+ score = score_trees (elem -> hash , hash2 );
142142 if (* best_score < score ) {
143143 free (* best_match );
144144 * best_match = xstrfmt ("%s%s" , base , path );
145145 * best_score = score ;
146146 }
147147 if (recurse_limit ) {
148148 char * newbase = xstrfmt ("%s%s/" , base , path );
149- match_trees (elem , hash2 , best_score , best_match ,
149+ match_trees (elem -> hash , hash2 , best_score , best_match ,
150150 newbase , recurse_limit - 1 );
151151 free (newbase );
152152 }
@@ -191,15 +191,15 @@ static int splice_tree(const unsigned char *hash1,
191191 while (desc .size ) {
192192 const char * name ;
193193 unsigned mode ;
194- const unsigned char * sha1 ;
194+ const struct object_id * oid ;
195195
196- sha1 = tree_entry_extract (& desc , & name , & mode );
196+ oid = tree_entry_extract (& desc , & name , & mode );
197197 if (strlen (name ) == toplen &&
198198 !memcmp (name , prefix , toplen )) {
199199 if (!S_ISDIR (mode ))
200200 die ("entry %s in tree %s is not a tree" ,
201201 name , sha1_to_hex (hash1 ));
202- rewrite_here = (unsigned char * ) sha1 ;
202+ rewrite_here = (unsigned char * ) oid -> hash ;
203203 break ;
204204 }
205205 update_tree_entry (& desc );
0 commit comments