write_file_v(): do not leave incomplete line at the end
authorJunio C Hamano <gitster@pobox.com>
Mon, 24 Aug 2015 16:39:48 +0000 (09:39 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 25 Aug 2015 19:48:39 +0000 (12:48 -0700)
All existing callers to this function use it to produce a text file
or an empty file, and a new callsite that mimick them must end their
payload with a LF. If they forget to do so, the resulting file will
end with an incomplete line.

Teach write_file_v() to complete the incomplete line, if exists, so
that the callers do not have to.

With this, the caller-side fix in builtin/am.c becomes unnecessary.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found