Skip to content

Commit f1dcdd6

Browse files
KarthikNayakgitster
authored andcommitted
reftable: pick either 'oid' or 'target' for new updates
When creating a reference transaction update, we can provide the old/new oid/target for the update. We have checks in place to ensure that for each old/new, either oid or target is set and not both. In the reftable backend, when dealing with updates without the `REF_NO_DEREF` flag, we don't selectively propagate data as needed. Since there are no active users of the path, this is not caught. As we want to introduce the 'symref-update' command in the upcoming commit, which would use this flow, correct it. Helped-by: Patrick Steinhardt <[email protected]> Signed-off-by: Karthik Nayak <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ed32727 commit f1dcdd6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

refs/reftable-backend.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,8 +898,9 @@ static int reftable_be_transaction_prepare(struct ref_store *ref_store,
898898
*/
899899
new_update = ref_transaction_add_update(
900900
transaction, referent.buf, new_flags,
901-
&u->new_oid, &u->old_oid, u->new_target,
902-
u->old_target, u->msg);
901+
u->new_target ? NULL : &u->new_oid,
902+
u->old_target ? NULL : &u->old_oid,
903+
u->new_target, u->old_target, u->msg);
903904

904905
new_update->parent_update = u;
905906

0 commit comments

Comments
 (0)