@@ -207,7 +207,7 @@ struct patch {
207207 struct patch * next ;
208208
209209 /* three-way fallback result */
210- unsigned char threeway_stage [3 ][ 20 ];
210+ struct object_id threeway_stage [3 ];
211211};
212212
213213static void free_fragment_list (struct fragment * list )
@@ -3418,11 +3418,11 @@ static int try_threeway(struct image *image, struct patch *patch,
34183418 if (status ) {
34193419 patch -> conflicted_threeway = 1 ;
34203420 if (patch -> is_new )
3421- hashclr ( patch -> threeway_stage [0 ]);
3421+ oidclr ( & patch -> threeway_stage [0 ]);
34223422 else
3423- hashcpy (patch -> threeway_stage [0 ], pre_sha1 );
3424- hashcpy (patch -> threeway_stage [1 ], our_sha1 );
3425- hashcpy (patch -> threeway_stage [2 ], post_sha1 );
3423+ hashcpy (patch -> threeway_stage [0 ]. hash , pre_sha1 );
3424+ hashcpy (patch -> threeway_stage [1 ]. hash , our_sha1 );
3425+ hashcpy (patch -> threeway_stage [2 ]. hash , post_sha1 );
34263426 fprintf (stderr , "Applied patch to '%s' with conflicts.\n" , patch -> new_name );
34273427 } else {
34283428 fprintf (stderr , "Applied patch to '%s' cleanly.\n" , patch -> new_name );
@@ -4046,14 +4046,14 @@ static void add_conflicted_stages_file(struct patch *patch)
40464046
40474047 remove_file_from_cache (patch -> new_name );
40484048 for (stage = 1 ; stage < 4 ; stage ++ ) {
4049- if (is_null_sha1 ( patch -> threeway_stage [stage - 1 ]))
4049+ if (is_null_oid ( & patch -> threeway_stage [stage - 1 ]))
40504050 continue ;
40514051 ce = xcalloc (1 , ce_size );
40524052 memcpy (ce -> name , patch -> new_name , namelen );
40534053 ce -> ce_mode = create_ce_mode (mode );
40544054 ce -> ce_flags = create_ce_flags (stage );
40554055 ce -> ce_namelen = namelen ;
4056- hashcpy (ce -> sha1 , patch -> threeway_stage [stage - 1 ]);
4056+ hashcpy (ce -> sha1 , patch -> threeway_stage [stage - 1 ]. hash );
40574057 if (add_cache_entry (ce , ADD_CACHE_OK_TO_ADD ) < 0 )
40584058 die (_ ("unable to add cache entry for %s" ), patch -> new_name );
40594059 }
0 commit comments