summaryrefslogtreecommitdiff
path: root/t/t4013/diff.diff_initial..side
diff options
context:
space:
mode:
authorAntonio De Stefani <antonio.destefani08@gmail.com>2026-06-24 11:36:18 +0200
committerJunio C Hamano <gitster@pobox.com>2026-06-24 09:49:05 -0700
commit5dea8b690b50a4f4d11ddc8f2f6cd24a816102ad (patch)
tree7d3b49bc64d77aebcbac724dc45f821616f4d86f /t/t4013/diff.diff_initial..side
parent3e65291872de10c3f0bf05ea8c24187e7a71ebf0 (diff)
gpg-interface: fix strip_cr_before_lf to only remove CR before LF
c4adea82c5 (Convert CR/LF to LF in tag signatures, 2008-07-11) introduced CR stripping for GPG output on Windows, but intentionally stripped all CR characters unconditionally to "keep the code simpler", even though only CRLF sequences (Windows line endings) needed to be normalized. Later 2f47eae2a1 (Split GPG interface into its own helper library, 2011-09-07) moved the code into gpg-interface.c, and 29b315778e (ssh signing: add ssh key format and signing code, 2021-09-10) extracted it into the remove_cr_after() helper when adding SSH signing support, while noticing that it unconditionally strips all CRs, leaving a NEEDSWORK comment. Fix the loop to skip CR only when immediately followed by LF, keeping lone trailing CR characters intact. Rename the function to strip_cr_before_lf to reflect its corrected behavior, and update both call sites and their comments accordingly. Signed-off-by: Antonio De Stefani <antonio.destefani08@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.diff_initial..side')
0 files changed, 0 insertions, 0 deletions