diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-06-06 07:29:11 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-06-06 18:04:31 +0200 |
commit | fbd1a693c7343d4b37ae6d99b19f15d1293b77c2 (patch) | |
tree | e2c96bb1db5765adde2e1654b3eb22cd943d0a39 /refs.h | |
parent | refs: pass storage format to `ref_store_init()` explicitly (diff) | |
download | git-fbd1a693c7343d4b37ae6d99b19f15d1293b77c2.tar.xz git-fbd1a693c7343d4b37ae6d99b19f15d1293b77c2.zip |
refs: allow to skip creation of reflog entries
The ref backends do not have any way to disable the creation of reflog
entries. This will be required for upcoming ref format migration logic
so that we do not create any entries that didn't exist in the original
ref database.
Provide a new `REF_SKIP_CREATE_REFLOG` flag that allows the caller to
disable reflog entry creation.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r-- | refs.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -660,12 +660,18 @@ struct ref_transaction *ref_store_transaction_begin(struct ref_store *refs, #define REF_SKIP_REFNAME_VERIFICATION (1 << 11) /* + * Skip creation of a reflog entry, even if it would have otherwise been + * created. + */ +#define REF_SKIP_CREATE_REFLOG (1 << 12) + +/* * Bitmask of all of the flags that are allowed to be passed in to * ref_transaction_update() and friends: */ #define REF_TRANSACTION_UPDATE_ALLOWED_FLAGS \ (REF_NO_DEREF | REF_FORCE_CREATE_REFLOG | REF_SKIP_OID_VERIFICATION | \ - REF_SKIP_REFNAME_VERIFICATION) + REF_SKIP_REFNAME_VERIFICATION | REF_SKIP_CREATE_REFLOG) /* * Add a reference update to transaction. `new_oid` is the value that |