summaryrefslogtreecommitdiffstats
path: root/branch.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 /branch.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 'branch.c')
-rw-r--r--branch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/branch.c b/branch.c
index 621019fcf4..3ebcfdca65 100644
--- a/branch.c
+++ b/branch.c
@@ -627,7 +627,7 @@ void create_branch(struct repository *r,
if (!transaction ||
ref_transaction_update(transaction, ref.buf,
&oid, forcing ? NULL : null_oid(),
- 0, msg, &err) ||
+ NULL, NULL, 0, msg, &err) ||
ref_transaction_commit(transaction, &err))
die("%s", err.buf);
ref_transaction_free(transaction);