Thread (3 messages) flat view 3 messages, 3 authors, 2026-01-15

Re: [PATCH 4/6] update-ref: utilize rejected error details if available

From: Junio C Hamano <hidden>
Date: 2026-01-14 17:27:30

Karthik Nayak [off-list ref] writes:
quoted hunk
@@ -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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help