ssh signing: return an error when signature cannot be read
commit36fb0d07d83df475bc6b716795b2111f8408cbcf
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Tue, 4 Oct 2022 10:01:34 +0000 (4 10:01 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Oct 2022 17:21:52 +0000 (5 10:21 -0700)
tree418c8d2591b673c635dfc5aac0dd5c2285349b60
parenta0feb8611d4c0b2b5d954efe4e98207f62223436
ssh signing: return an error when signature cannot be read

If the signature file cannot be read we print an error message but do
not return an error to the caller. In practice it seems unlikely that
the file would be unreadable if the call to ssh-keygen succeeds.

The unlink_or_warn() call is moved to the end of the function so that
we always try and remove the signature file. This isn't strictly
necessary at the moment but it protects us against any extra code
being added between trying to read the signature file and the cleanup
at the end of the function in the future. unlink_or_warn() only prints
a warning if it exists and cannot be removed.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gpg-interface.c