@@ -207,7 +207,7 @@ struct patch {
207
207
struct patch * next ;
208
208
209
209
/* three-way fallback result */
210
- unsigned char threeway_stage [3 ][ 20 ];
210
+ struct object_id threeway_stage [3 ];
211
211
};
212
212
213
213
static void free_fragment_list (struct fragment * list )
@@ -3418,11 +3418,11 @@ static int try_threeway(struct image *image, struct patch *patch,
3418
3418
if (status ) {
3419
3419
patch -> conflicted_threeway = 1 ;
3420
3420
if (patch -> is_new )
3421
- hashclr ( patch -> threeway_stage [0 ]);
3421
+ oidclr ( & patch -> threeway_stage [0 ]);
3422
3422
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 );
3426
3426
fprintf (stderr , "Applied patch to '%s' with conflicts.\n" , patch -> new_name );
3427
3427
} else {
3428
3428
fprintf (stderr , "Applied patch to '%s' cleanly.\n" , patch -> new_name );
@@ -4046,14 +4046,14 @@ static void add_conflicted_stages_file(struct patch *patch)
4046
4046
4047
4047
remove_file_from_cache (patch -> new_name );
4048
4048
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 ]))
4050
4050
continue ;
4051
4051
ce = xcalloc (1 , ce_size );
4052
4052
memcpy (ce -> name , patch -> new_name , namelen );
4053
4053
ce -> ce_mode = create_ce_mode (mode );
4054
4054
ce -> ce_flags = create_ce_flags (stage );
4055
4055
ce -> ce_namelen = namelen ;
4056
- hashcpy (ce -> sha1 , patch -> threeway_stage [stage - 1 ]);
4056
+ hashcpy (ce -> sha1 , patch -> threeway_stage [stage - 1 ]. hash );
4057
4057
if (add_cache_entry (ce , ADD_CACHE_OK_TO_ADD ) < 0 )
4058
4058
die (_ ("unable to add cache entry for %s" ), patch -> new_name );
4059
4059
}
0 commit comments