File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,14 +50,20 @@ start_socks() {
5050
5151# The %30 tests that the correct amount of percent-encoding is applied to the
5252# proxy string passed to curl.
53+ # Use a short path for the socket to avoid exceeding the 108-character
54+ # Unix domain socket limit when the trash directory path is long.
55+ SOCKS_TMPDIR=$( mktemp -d)
56+ SOCKS_SOCK=" $SOCKS_TMPDIR /%30.sock"
57+
5358test_lazy_prereq SOCKS_PROXY '
5459 test_have_prereq PERL &&
55- start_socks "$TRASH_DIRECTORY/%30.sock "
60+ start_socks "$SOCKS_SOCK "
5661'
5762
5863test_atexit '
5964 test ! -e "$TRASH_DIRECTORY/socks.pid" ||
6065 kill "$(cat "$TRASH_DIRECTORY/socks.pid")"
66+ rm -rf "$SOCKS_TMPDIR"
6167'
6268
6369# The below tests morally ought to be gated on a prerequisite that Git is
@@ -70,7 +76,8 @@ old_libcurl_error() {
7076
7177test_expect_success SOCKS_PROXY ' clone via Unix socket' '
7278 test_when_finished "rm -rf clone" &&
73- test_config_global http.proxy "socks4://localhost$PWD/%2530.sock" && {
79+ socks_proxy_url="socks4://localhost$(echo "$SOCKS_SOCK" | sed "s/%/%25/g")" &&
80+ test_config_global http.proxy "$socks_proxy_url" && {
7481 {
7582 GIT_TRACE_CURL=$PWD/trace \
7683 GIT_TRACE_CURL_COMPONENTS=socks \
You can’t perform that action at this time.
0 commit comments