Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2021-12-07 16:38:18 +0300
committerJunio C Hamano <gitster@pobox.com>2021-12-08 00:15:19 +0300
commit3c966c7b4e97a5399662f85ab73af08a6419a303 (patch)
treeec71406c8d372ae48eae9be1c109be9546afa7ab /refs.h
parente9706a188f8598ea4d8afac1f70360abb77d4d8d (diff)
refs: introduce REF_SKIP_REFNAME_VERIFICATION flag
Use this flag with the test-helper in t1430, to avoid direct writes to the ref database. 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.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/refs.h b/refs.h
index 76efc589cc..65017ceaef 100644
--- a/refs.h
+++ b/refs.h
@@ -622,11 +622,17 @@ struct ref_transaction *ref_transaction_begin(struct strbuf *err);
#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 | REF_SKIP_OID_VERIFICATION)
+#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