]> git.ipfire.org Git - thirdparty/git.git/commit
update-ref: utilize rejected error details if available
authorKarthik Nayak <karthik.188@gmail.com>
Fri, 16 Jan 2026 21:27:09 +0000 (22:27 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Jan 2026 22:06:44 +0000 (14:06 -0800)
commit972fb3ccb7b564fa95898ff1c0902ea2d9c7f6c0
treea6a401fd9cd7ca17f4f74c6c3d5bad142dc1a2e2
parentb72378a4c171d372c164af6f0f8b963101991dcd
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