diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-08-06 07:54:14 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-08-06 07:36:29 -0700 |
| commit | 1ffd2d41599e2b506f20430914e3bc53a0e05f3a (patch) | |
| tree | 4a7169b6f8713e0b984fbfb87a6f48a676c178e0 /refs.h | |
| parent | 649c7bb77a173c6ef2c27fc64b8689aee9b0b8a8 (diff) | |
| download | git-1ffd2d41599e2b506f20430914e3bc53a0e05f3a.tar.xz | |
refs: export `ref_transaction_update_reflog()`
In a subsequent commit we'll add another user that wants to write reflog
entries. This requires them to call `ref_transaction_update_reflog()`,
but that function is local to "refs.c".
Export the function to prepare for the change. While at it, drop the
`flags` field, as all callers are for now expected to use the same flags
anyway.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
| -rw-r--r-- | refs.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -796,6 +796,21 @@ int ref_transaction_update(struct ref_transaction *transaction, struct strbuf *err); /* + * Similar to `ref_transaction_update`, but this function is only for adding + * a reflog update. Supports providing custom committer information. The index + * field can be utiltized to order updates as desired. When set to zero, the + * updates default to being ordered by refname. + */ +int ref_transaction_update_reflog(struct ref_transaction *transaction, + const char *refname, + const struct object_id *new_oid, + const struct object_id *old_oid, + const char *committer_info, + const char *msg, + uint64_t index, + struct strbuf *err); + +/* * Add a reference creation to transaction. new_oid is the value that * the reference should have after the update; it must not be * null_oid. It is verified that the reference does not exist |
