diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-12-15 20:39:54 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-15 20:39:54 +0300 |
commit | b174a3c01423897154d26c96baab366229f16976 (patch) | |
tree | 95615d66817ffcc6e111cfa95fb591017e474980 /refs.h | |
parent | bc32aa1e63218b0011159af4703e1389354c69f9 (diff) | |
parent | 9912391402ad1b910c6d712565553d7e5b22d7e1 (diff) |
Merge branch 'hn/allow-bogus-oid-in-ref-tests'
The test helper for refs subsystem learned to write bogus and/or
nonexistent object name to refs to simulate error situations we
want to test Git in.
* hn/allow-bogus-oid-in-ref-tests:
t1430: create valid symrefs using test-helper
t1430: remove refs using test-tool
refs: introduce REF_SKIP_REFNAME_VERIFICATION flag
refs: introduce REF_SKIP_OID_VERIFICATION flag
refs: update comment.
test-ref-store: plug memory leak in cmd_delete_refs
test-ref-store: parse symbolic flag constants
test-ref-store: remove force-create argument for create-reflog
Diffstat (limited to 'refs.h')
-rw-r--r-- | refs.h | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -638,11 +638,23 @@ 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) + +/* + * Skip verifying refname. This is useful for testing data corruption scenarios. + */ +#define REF_SKIP_REFNAME_VERIFICATION (1 << 11) + +/* * 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) +#define REF_TRANSACTION_UPDATE_ALLOWED_FLAGS \ + (REF_NO_DEREF | REF_FORCE_CREATE_REFLOG | REF_SKIP_OID_VERIFICATION | \ + REF_SKIP_REFNAME_VERIFICATION) /* * Add a reference update to transaction. `new_oid` is the value that |