refs: add rejection detail to the callback function
The previous commit started storing the rejection details alongside the error code for rejected updates. Pass this along to the callback function `ref_transaction_for_each_rejected_update()`. Currently the field is unused, but will be integrated in the upcoming commits. Co-authored-by: Jeff King <peff@peff.net> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karthik Nayak committed
Jan 25, 2026 at 23:52 UTC
be54b10fd7f313b107c00061349a6a46e9eb926e
5 files changed
+5
-1
builtin/fetch.c
+1
@@ -1649,6 +1649,7 @@ static void ref_transaction_rejection_handler(const char *refname,
1649
const char *old_target UNUSED,
1650
const char *new_target UNUSED,
1651
enum ref_transaction_error err,
1652
+ const char *details UNUSED,
1653
void *cb_data)
1654
{
1655
struct ref_rejection_data *data = cb_data;
builtin/receive-pack.c
+1
@@ -1813,6 +1813,7 @@ static void ref_transaction_rejection_handler(const char *refname,
1813
const char *old_target UNUSED,
1814
const char *new_target UNUSED,
1815
enum ref_transaction_error err,
1816
+ const char *details UNUSED,
1817
void *cb_data)
1818
{
1819
struct strmap *failed_refs = cb_data;
builtin/update-ref.c
+1
@@ -573,6 +573,7 @@ static void print_rejected_refs(const char *refname,
573
const char *old_target,
574
const char *new_target,
575
enum ref_transaction_error err,
576
+ const char *details UNUSED,
577
void *cb_data UNUSED)
578
{
579
struct strbuf sb = STRBUF_INIT;
refs.c
+1
-1
@@ -2874,7 +2874,7 @@ void ref_transaction_for_each_rejected_update(struct ref_transaction *transactio
2874
(update->flags & REF_HAVE_OLD) ? &update->old_oid : NULL,
2875
(update->flags & REF_HAVE_NEW) ? &update->new_oid : NULL,
2876
update->old_target, update->new_target,
2877
- update->rejection_err, cb_data);
2877
+ update->rejection_err, update->rejection_details, cb_data);
2878
}
2879
}
2880
refs.h
+1
@@ -975,6 +975,7 @@ typedef void ref_transaction_for_each_rejected_update_fn(const char *refname,
975
const char *old_target,
976
const char *new_target,
977
enum ref_transaction_error err,
978
+ const char *details,
979
void *cb_data);
980
void ref_transaction_for_each_rejected_update(struct ref_transaction *transaction,
981
ref_transaction_for_each_rejected_update_fn cb,