diff.c: move line ending check into emit_hunk_header
commitdfb7728f637e8178189f9f8f0092797403c73509
authorStefan Beller <sbeller@google.com>
Fri, 30 Jun 2017 00:06:47 +0000 (29 17:06 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 30 Jun 2017 20:13:01 +0000 (30 13:13 -0700)
tree31f34af07631a5c52f8a6e1f1c9a88e3fe5934dd
parentf2d2a5def088b474586eedfa4fa547bc2c955bb9
diff.c: move line ending check into emit_hunk_header

The emit_hunk_header() function is responsible for assembling a
hunk header and calling emit_line() to send the hunk header
to the output file.  Its only caller fn_out_consume() needs
to prepare for a case where the function emits an incomplete
line and add the terminating LF.

Instead make sure emit_hunk_header() to always send a
completed line to emit_line().

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c