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>
Michael Haggerty committed
Nov 5, 2017 at 09:42 UTC
b0ca411051d8444b4b32bda3fdd0aba871035d2a
1 file changed
+2
-2
refs/files-backend.c
+2
-2
@@ -2594,8 +2594,8 @@ static int files_transaction_prepare(struct ref_store *ref_store,
2594
2595
ref_transaction_add_update(
2596
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,
2599
NULL);
2600
}
2601
}