summaryrefslogtreecommitdiffstats
path: root/refs.h
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2024-06-07 15:33:00 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-07 19:25:44 +0200
commit1451ac734ffc1b9c45af12a2485c6d2ee69a6a76 (patch)
treeba463011bb620635c1710b54f453346c05c25cef /refs.h
parentrefs: specify error for regular refs with `old_target` (diff)
downloadgit-1451ac734ffc1b9c45af12a2485c6d2ee69a6a76.tar.xz
git-1451ac734ffc1b9c45af12a2485c6d2ee69a6a76.zip
update-ref: add support for 'symref-verify' command
The 'symref-verify' command allows users to verify if a provided <ref> contains the provided <old-target> without changing the <ref>. If <old-target> is not provided, the command will verify that the <ref> doesn't exist. The command allows users to verify symbolic refs within a transaction, and this means users can perform a set of changes in a transaction only when the verification holds good. Since we're checking for symbolic refs, this command will only work with the 'no-deref' mode. This is because any dereferenced symbolic ref will point to an object and not a ref and the regular 'verify' command can be used in such situations. Add required tests for symref support in 'verify'. Since we're here, also add reflog checks for the pre-existing 'verify' tests, there is no divergence from behavior, but we never tested to ensure that reflog wasn't affected by the 'verify' command. Helped-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index 71cc1c58e0..48cec1ba72 100644
--- a/refs.h
+++ b/refs.h
@@ -781,6 +781,7 @@ int ref_transaction_delete(struct ref_transaction *transaction,
int ref_transaction_verify(struct ref_transaction *transaction,
const char *refname,
const struct object_id *old_oid,
+ const char *old_target,
unsigned int flags,
struct strbuf *err);