]> git.ipfire.org Git - thirdparty/git.git/commit
send-email: capture errors in an eval {} block
authorZheng Yuting <05zyt30@gmail.com>
Wed, 26 Mar 2025 07:52:45 +0000 (15:52 +0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Apr 2025 21:54:05 +0000 (14:54 -0700)
commitce20dec4a4de8a75cbc9735538c9430e68d3c1f8
treecb0e1b53041549228ab0d7643f72c299aa67ba20
parent683c54c999c301c2cd6f715c411407c413b1d84e
send-email: capture errors in an eval {} block

Auth relied solely on return values without catching errors. This misjudges
non-credential errors as auth failure without error info.

Patch wraps the entire auth process in an eval {} block to catch
all exceptions, including non-credential errors. It adds a new $error var,
uses 'or do' to prevent flow break, and returns $result ? 1 : 0. And merges
if/else branches, integrates SASL and basic auth, with comments for
future status code handling.

Signed-off-by: Zheng Yuting <05ZYT30@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl