summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorLibravatar Michael Haggerty <mhagger@alum.mit.edu>2017-11-05 09:42:01 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-11-06 10:31:07 +0900
commitb0ca411051d8444b4b32bda3fdd0aba871035d2a (patch)
tree2779711b5a80992093cec81b77d9edfb73f97f29 /refs
parentMerge branch 'bc/object-id' into base (diff)
downloadtgif-b0ca411051d8444b4b32bda3fdd0aba871035d2a.tar.xz
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>
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 2bd54e11ae..fadf1036d3 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2594,8 +2594,8 @@ static int files_transaction_prepare(struct ref_store *ref_store,
ref_transaction_add_update(
packed_transaction, update->refname,
- update->flags & ~REF_HAVE_OLD,
- &update->new_oid, &update->old_oid,
+ REF_HAVE_NEW | REF_NODEREF,
+ &update->new_oid, NULL,
NULL);
}
}