summaryrefslogtreecommitdiffstats
path: root/walker.c
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2024-05-07 14:58:52 +0200
committerJunio C Hamano <gitster@pobox.com>2024-05-07 17:51:49 +0200
commit1bc4cc3fc4276203e62de610a712c8ddea45b5cf (patch)
treefb840cc30e5e6043632e0987d2250c68cb6994d4 /walker.c
parentThe seventeenth batch (diff)
downloadgit-1bc4cc3fc4276203e62de610a712c8ddea45b5cf.tar.xz
git-1bc4cc3fc4276203e62de610a712c8ddea45b5cf.zip
refs: accept symref values in `ref_transaction_update()`
The function `ref_transaction_update()` obtains ref information and flags to create a `ref_update` and add them to the transaction at hand. To extend symref support in transactions, we need to also accept the old and new ref targets and process it. This commit adds the required parameters to the function and modifies all call sites. The two parameters added are `new_target` and `old_target`. The `new_target` is used to denote what the reference should point to when the transaction is applied. Some functions allow this parameter to be NULL, meaning that the reference is not changed. The `old_target` denotes the value the reference must have before the update. Some functions allow this parameter to be NULL, meaning that the old value of the reference is not checked. We also update the internal function `ref_transaction_add_update()` similarly to take the two new parameters. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'walker.c')
-rw-r--r--walker.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/walker.c b/walker.c
index c0fd632d92..1b3df43906 100644
--- a/walker.c
+++ b/walker.c
@@ -324,7 +324,7 @@ int walker_fetch(struct walker *walker, int targets, char **target,
strbuf_reset(&refname);
strbuf_addf(&refname, "refs/%s", write_ref[i]);
if (ref_transaction_update(transaction, refname.buf,
- oids + i, NULL, 0,
+ oids + i, NULL, NULL, NULL, 0,
msg ? msg : "fetch (unknown)",
&err)) {
error("%s", err.buf);