diff options
author | Han-Wen Nienhuys <hanwen@google.com> | 2021-12-07 13:38:17 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-07 13:15:19 -0800 |
commit | e9706a188f8598ea4d8afac1f70360abb77d4d8d (patch) | |
tree | 0824e81e26b7119053a7e6669c93f6a2743daf85 /refs.h | |
parent | 0464d0a134df97c3f9475c58e536c3b685a3ff7d (diff) | |
download | git-e9706a188f8598ea4d8afac1f70360abb77d4d8d.tar.gz |
refs: introduce REF_SKIP_OID_VERIFICATION flag
This lets the ref-store test helper write non-existent or unparsable objects
into the ref storage.
Use this to make t1006 and t3800 independent of the files storage backend.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
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
@@ -616,11 +616,17 @@ struct ref_transaction *ref_transaction_begin(struct strbuf *err); #define REF_FORCE_CREATE_REFLOG (1 << 1) /* + * Blindly write an object_id. This is useful for testing data corruption + * scenarios. + */ +#define REF_SKIP_OID_VERIFICATION (1 << 10) + +/* * 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_NO_DEREF | REF_FORCE_CREATE_REFLOG | REF_SKIP_OID_VERIFICATION) /* * Add a reference update to transaction. `new_oid` is the value that |