apply: convert threeway_stage to object_id
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Mar 13, 2015 at 23:39 UTC
d07d4ab401173a10173f2747cf5e0f074b6d2b39
1 file changed
+7
-7
builtin/apply.c
+7
-7
@@ -207,7 +207,7 @@ struct patch {
207
struct patch *next;
208
209
/* three-way fallback result */
210
- unsigned char threeway_stage[3][20];
210
+ struct object_id threeway_stage[3];
211
};
212
213
static void free_fragment_list(struct fragment *list)
@@ -3418,11 +3418,11 @@ static int try_threeway(struct image *image, struct patch *patch,
3418
if (status) {
3419
patch->conflicted_threeway = 1;
3420
if (patch->is_new)
3421
- hashclr(patch->threeway_stage[0]);
3421
+ oidclr(&patch->threeway_stage[0]);
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
fprintf(stderr, "Applied patch to '%s' with conflicts.\n", patch->new_name);
3427
} else {
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
4047
remove_file_from_cache(patch->new_name);
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
continue;
4051
ce = xcalloc(1, ce_size);
4052
memcpy(ce->name, patch->new_name, namelen);
4053
ce->ce_mode = create_ce_mode(mode);
4054
ce->ce_flags = create_ce_flags(stage);
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
if (add_cache_entry(ce, ADD_CACHE_OK_TO_ADD) < 0)
4058
die(_("unable to add cache entry for %s"), patch->new_name);
4059
}