Skip to content

Commit ef52c17

Browse files
rimruldscho
authored andcommitted
credential-cache: handle ECONNREFUSED gracefully
In 245670c (credential-cache: check for windows specific errors, 2021-09-14) we concluded that on Windows we would always encounter ENETDOWN where we would expect ECONNREFUSED on POSIX systems, when connecting to unix sockets. As reported in [1], we do encounter ECONNREFUSED on Windows if the socket file doesn't exist, but the containing directory does and ENETDOWN if neither exists. We should handle this case like we do on non-windows systems. [1] git-for-windows#4762 (comment) This fixes git-for-windows#5314 Helped-by: M Hickford <[email protected]> Signed-off-by: Matthias Aßhauer <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent c4d7ea8 commit ef52c17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/credential-cache.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static int connection_closed(int error)
2323

2424
static int connection_fatally_broken(int error)
2525
{
26-
return (error != ENOENT) && (error != ENETDOWN);
26+
return (error != ENOENT) && (error != ENETDOWN) && (error != ECONNREFUSED);
2727
}
2828

2929
#else

0 commit comments

Comments
 (0)