diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-08-12 11:54:19 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-08-12 07:40:59 -0700 |
| commit | 178c5885007b83dd10cac1e09b72ef8d9fe2ac29 (patch) | |
| tree | 9d00bd40837cd9c1d026140d419f673ac8c9c2e3 /refs | |
| parent | 6fb1d819b7c7796e7cfaae44f056d73436469efc (diff) | |
| download | git-178c5885007b83dd10cac1e09b72ef8d9fe2ac29.tar.gz | |
reftable/stack: allow passing flags to `reftable_stack_add()`
The `reftable_stack_add()` function is a simple wrapper to lock the
stack, add records to it via a callback and then commit the
result. One problem with it though is that it doesn't accept any flags
for creating the addition. This makes it impossible to automatically
reload the stack in case it was modified before we managed to lock the
stack.
Add a `flags` field to plug this gap and pass it through accordingly.
For now this new flag won't be used by us, but it will be used by
libgit2.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs')
| -rw-r--r-- | refs/reftable-backend.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/refs/reftable-backend.c b/refs/reftable-backend.c index 4c3817f4ec..3f0deab338 100644 --- a/refs/reftable-backend.c +++ b/refs/reftable-backend.c @@ -1960,7 +1960,7 @@ static int reftable_be_rename_ref(struct ref_store *ref_store, ret = backend_for(&arg.be, refs, newrefname, &newrefname, 1); if (ret) goto done; - ret = reftable_stack_add(arg.be->stack, &write_copy_table, &arg); + ret = reftable_stack_add(arg.be->stack, &write_copy_table, &arg, 0); done: assert(ret != REFTABLE_API_ERROR); @@ -1989,7 +1989,7 @@ static int reftable_be_copy_ref(struct ref_store *ref_store, ret = backend_for(&arg.be, refs, newrefname, &newrefname, 1); if (ret) goto done; - ret = reftable_stack_add(arg.be->stack, &write_copy_table, &arg); + ret = reftable_stack_add(arg.be->stack, &write_copy_table, &arg, 0); done: assert(ret != REFTABLE_API_ERROR); @@ -2360,7 +2360,7 @@ static int reftable_be_create_reflog(struct ref_store *ref_store, goto done; arg.stack = be->stack; - ret = reftable_stack_add(be->stack, &write_reflog_existence_table, &arg); + ret = reftable_stack_add(be->stack, &write_reflog_existence_table, &arg, 0); done: return ret; @@ -2431,7 +2431,7 @@ static int reftable_be_delete_reflog(struct ref_store *ref_store, return ret; arg.stack = be->stack; - ret = reftable_stack_add(be->stack, &write_reflog_delete_table, &arg); + ret = reftable_stack_add(be->stack, &write_reflog_delete_table, &arg, 0); assert(ret != REFTABLE_API_ERROR); return ret; |
