replay: expose `replay_result_queue_update()`

Expose `replay_result_queue_update()`, which is used to append another
reference update to the replay result. This function will be used in a
subsequent commit.

Suggested-by: Christian Couder <christian.couder@gmail.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
next
Patrick Steinhardt 2026-07-01 13:35:36 +02:00 committed by Junio C Hamano
parent e420d7b0ac
commit 27717e2069
2 changed files with 9 additions and 4 deletions

View File

@ -351,10 +351,10 @@ void replay_result_release(struct replay_result *result)
free(result->updates);
}

static void replay_result_queue_update(struct replay_result *result,
const char *refname,
const struct object_id *old_oid,
const struct object_id *new_oid)
void replay_result_queue_update(struct replay_result *result,
const char *refname,
const struct object_id *old_oid,
const struct object_id *new_oid)
{
ALLOC_GROW(result->updates, result->updates_nr + 1, result->updates_alloc);
result->updates[result->updates_nr].refname = xstrdup(refname);

View File

@ -80,6 +80,11 @@ struct replay_result {

void replay_result_release(struct replay_result *result);

void replay_result_queue_update(struct replay_result *result,
const char *refname,
const struct object_id *old_oid,
const struct object_id *new_oid);

/*
* Replay a set of commits onto a new location. Leaves both the working tree,
* index and references untouched. Reference updates caused by the replay will