Re: [PATCH 4/6] update-ref: utilize rejected error details if available
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 14, 2026, 17:27 UTC
- Message-ID
- <xmqqpl7cf6kf.fsf@gitster.g>
- In-Reply-To
- <20260114-633-regression-lost-diagnostic-message-when-pushing-non-commit-objects-to-refs-heads-v1-4-f5f8b173c501@gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 22 quoted lines
> @@ -573,16 +573,18 @@ static void print_rejected_refs(const char *refname,
> const char *old_target,
> const char *new_target,
> enum ref_transaction_error err,
> - const char *details UNUSED,
> + const char *details,
> void *cb_data UNUSED)
> {
> struct strbuf sb = STRBUF_INIT;
> - const char *reason = ref_transaction_error_msg(err);
>
> - strbuf_addf(&sb, "rejected %s %s %s %s\n", refname,
> - new_oid ? oid_to_hex(new_oid) : new_target,
> - old_oid ? oid_to_hex(old_oid) : old_target,
> - reason);
> + if (details)
> + strbuf_addf(&sb, "%s\n", details);
> + else
> + strbuf_addf(&sb, "rejected %s %s %s %s\n", refname,
> + new_oid ? oid_to_hex(new_oid) : new_target,
> + old_oid ? oid_to_hex(old_oid) : old_target,
> + ref_transaction_error_msg(err));Could "details" reported from the lower layer be less detailed than what we are formulating here, like updating the value of what ref from what old object to what new object, or what the err code tells the end-user?