@@ -150,15 +150,15 @@ static void show_result(void)
150150/* An empty entry never compares same, not even to another empty entry */
151151static int same_entry (struct name_entry * a , struct name_entry * b )
152152{
153- return a -> sha1 &&
154- b -> sha1 &&
155- !hashcmp (a -> sha1 , b -> sha1 ) &&
153+ return a -> oid &&
154+ b -> oid &&
155+ !oidcmp (a -> oid , b -> oid ) &&
156156 a -> mode == b -> mode ;
157157}
158158
159159static int both_empty (struct name_entry * a , struct name_entry * b )
160160{
161- return !(a -> sha1 || b -> sha1 );
161+ return !(a -> oid || b -> oid );
162162}
163163
164164static struct merge_list * create_entry (unsigned stage , unsigned mode , const unsigned char * sha1 , const char * path )
@@ -188,8 +188,8 @@ static void resolve(const struct traverse_info *info, struct name_entry *ours, s
188188 return ;
189189
190190 path = traverse_path (info , result );
191- orig = create_entry (2 , ours -> mode , ours -> sha1 , path );
192- final = create_entry (0 , result -> mode , result -> sha1 , path );
191+ orig = create_entry (2 , ours -> mode , ours -> oid -> hash , path );
192+ final = create_entry (0 , result -> mode , result -> oid -> hash , path );
193193
194194 final -> link = orig ;
195195
@@ -213,7 +213,7 @@ static void unresolved_directory(const struct traverse_info *info,
213213
214214 newbase = traverse_path (info , p );
215215
216- #define ENTRY_SHA1 (e ) (((e)->mode && S_ISDIR((e)->mode)) ? (e)->sha1 : NULL)
216+ #define ENTRY_SHA1 (e ) (((e)->mode && S_ISDIR((e)->mode)) ? (e)->oid->hash : NULL)
217217 buf0 = fill_tree_descriptor (t + 0 , ENTRY_SHA1 (n + 0 ));
218218 buf1 = fill_tree_descriptor (t + 1 , ENTRY_SHA1 (n + 1 ));
219219 buf2 = fill_tree_descriptor (t + 2 , ENTRY_SHA1 (n + 2 ));
@@ -239,7 +239,7 @@ static struct merge_list *link_entry(unsigned stage, const struct traverse_info
239239 path = entry -> path ;
240240 else
241241 path = traverse_path (info , n );
242- link = create_entry (stage , n -> mode , n -> sha1 , path );
242+ link = create_entry (stage , n -> mode , n -> oid -> hash , path );
243243 link -> link = entry ;
244244 return link ;
245245}
@@ -314,7 +314,7 @@ static int threeway_callback(int n, unsigned long mask, unsigned long dirmask, s
314314 }
315315
316316 if (same_entry (entry + 0 , entry + 1 )) {
317- if (entry [2 ].sha1 && !S_ISDIR (entry [2 ].mode )) {
317+ if (entry [2 ].oid && !S_ISDIR (entry [2 ].mode )) {
318318 /* We did not touch, they modified -- take theirs */
319319 resolve (info , entry + 1 , entry + 2 );
320320 return mask ;
0 commit comments