diff options
author | Matthias Aßhauer <mha1993@live.de> | 2024-04-03 15:42:02 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-04-03 14:54:28 -0700 |
commit | 2406bf5fc5fbaa042e05fc0001ba72beb888d60f (patch) | |
tree | 055d689b470c41a1f1631a35c1fb4c2428210a90 /builtin | |
parent | c75fd8d8150afdf836b63a8e0534d9b9e3e111ba (diff) | |
download | git-2406bf5fc5fbaa042e05fc0001ba72beb888d60f.tar.gz |
Win32: detect unix socket support at runtime
Windows 10 build 17063 introduced support for unix sockets to Windows.
bb390b1 (git-compat-util: include declaration for unix sockets in
windows, 2021-09-14) introduced a way to build git with unix socket
support on Windows, but you still had to decide at build time which
Windows version the compiled executable was supposed to run on.
We can detect at runtime wether the operating system supports unix
sockets and act accordingly for all supported Windows versions.
This fixes https://github.com/git-for-windows/git/issues/3892
Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/credential-cache--daemon.c | 2 | ||||
-rw-r--r-- | builtin/credential-cache.c | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/builtin/credential-cache--daemon.c b/builtin/credential-cache--daemon.c index 3a6a750a8e..17f929dede 100644 --- a/builtin/credential-cache--daemon.c +++ b/builtin/credential-cache--daemon.c @@ -294,6 +294,8 @@ int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix) argc = parse_options(argc, argv, prefix, options, usage, 0); socket_path = argv[0]; + if (!have_unix_sockets()) + die(_("credential-cache--daemon unavailable; no unix socket support")); if (!socket_path) usage_with_options(usage, options); diff --git a/builtin/credential-cache.c b/builtin/credential-cache.c index bba96d4ffd..bef120b537 100644 --- a/builtin/credential-cache.c +++ b/builtin/credential-cache.c @@ -149,6 +149,9 @@ int cmd_credential_cache(int argc, const char **argv, const char *prefix) usage_with_options(usage, options); op = argv[0]; + if (!have_unix_sockets()) + die(_("credential-cache unavailable; no unix socket support")); + if (!socket_path) socket_path = get_socket_path(); if (!socket_path) |