Skip to content

Commit b0ca411

Browse files
mhaggergitster
authored andcommitted
files_transaction_prepare(): don't leak flags to packed transaction
The files backend uses `ref_update::flags` for several internal flags. But those flags have no meaning to the packed backend. So when adding updates for the packed-refs transaction, only use flags that make sense to the packed backend. `REF_NODEREF` is part of the public interface, and it's logically what we want, so include it. In fact it is actually ignored by the packed backend (which doesn't support symbolic references), but that's its own business. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent ff08e56 commit b0ca411

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

refs/files-backend.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,8 +2594,8 @@ static int files_transaction_prepare(struct ref_store *ref_store,
25942594

25952595
ref_transaction_add_update(
25962596
packed_transaction, update->refname,
2597-
update->flags & ~REF_HAVE_OLD,
2598-
&update->new_oid, &update->old_oid,
2597+
REF_HAVE_NEW | REF_NODEREF,
2598+
&update->new_oid, NULL,
25992599
NULL);
26002600
}
26012601
}

0 commit comments

Comments
 (0)