]> git.ipfire.org Git - thirdparty/git.git/commit
update-ref: utilize rejected error details if available
authorKarthik Nayak <karthik.188@gmail.com>
Sun, 25 Jan 2026 22:52:38 +0000 (23:52 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 26 Jan 2026 06:27:33 +0000 (22:27 -0800)
commita366bdec0fb06a61d5c42e4047aab0658cec912e
treeefa12c828e5384474c482fd512c0c6175aaec48e
parentbe54b10fd7f313b107c00061349a6a46e9eb926e
update-ref: utilize rejected error details if available

When git-update-ref(1) received the '--update-ref' flag, the error
details generated in the refs namespace wasn't propagated with failed
updates. Instead only an error code pertaining to the type of rejection
was noted.

This missed detailed error message which the user can act upon. The
previous commits added the required code to propagate these detailed
error messages from the refs namespace. Now that additional details are
available, let's output this additional details to stderr. This allows
users to have additional information over the already present machine
parsable output.

While we're here, improve the existing tests for the machine parsable
output by checking for the entire output string and not just the
rejection reason.

Reported-by: Elijah Newren <newren@gmail.com>
Co-authored-by: Jeff King <peff@peff.net>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/update-ref.c
t/t1400-update-ref.sh