author | Jeff King <peff@peff.net> | |
Mon, 6 Feb 2012 08:13:12 +0000 (03:13 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 6 Feb 2012 18:00:42 +0000 (10:00 -0800) | ||
commit | ca51699961664890fdaabd276af539e6b3514053 | |
tree | 8ba79c2a018508e338d0fee3885fda0f562cda53 | tree | snapshot |
parent | f174a2583c9f42315b60205890fa67a79a1f1669 | commit | diff |
tag: fix output of "tag -n" when errors occur
When "git tag" is instructed to print lines from annotated
tags via "-n", it first prints the tag name, then attempts
to parse and print the lines of the tag object, and then
finally adds a trailing newline.
If an error occurs, we return early from the function and
never print the newline, screwing up the output for the next
tag. Let's factor the line-printing into its own function so
we can manage the early returns better, and make sure that
we always terminate the line.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When "git tag" is instructed to print lines from annotated
tags via "-n", it first prints the tag name, then attempts
to parse and print the lines of the tag object, and then
finally adds a trailing newline.
If an error occurs, we return early from the function and
never print the newline, screwing up the output for the next
tag. Let's factor the line-printing into its own function so
we can manage the early returns better, and make sure that
we always terminate the line.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/tag.c | diff | blob | history |