ls-files: fix "--format" output of relative paths
commitcfb62dd006ae82dd1e06fb177095c8885b40b1c3
authorAdam Johnson <me@adamj.eu>
Fri, 10 Mar 2023 13:04:33 +0000 (10 13:04 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Mar 2023 17:16:16 +0000 (10 09:16 -0800)
tree6c995a3f114d4c4ab06295722a45cadf79b45265
parentce74de931d7aea9746e37632534eacc63b0c1a90
ls-files: fix "--format" output of relative paths

Fix a bug introduced with the "--format" option in
ce74de93 (ls-files: introduce "--format" option, 2022-07-23),
where relative paths were computed using the output buffer,
which could lead to random garbage data in the output.

Signed-off-by: Adam Johnson <me@adamj.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/ls-files.c
t/t3013-ls-files-format.sh