Re: [PATCH 12/16] t5710: use proper file:// URIs for absolute paths
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Mar 26, 2026, 12:21 UTC
- Message-ID
- <acUkx8KwusUzYqne@pks.im>
- In-Reply-To
- <20260323080520.887550-13-christian.couder@gmail.com>
On Mon, Mar 23, 2026 at 09:05:15AM +0100, Christian Couder wrote:
Show 18 quoted lines
> diff --git a/t/t5710-promisor-remote-capability.sh b/t/t5710-promisor-remote-capability.sh
> index 357822c01a..c7a484228f 100755
> --- a/t/t5710-promisor-remote-capability.sh
> +++ b/t/t5710-promisor-remote-capability.sh
> @@ -76,6 +76,17 @@ copy_to_lop () {
> cp "$path" "$path2"
> }
>
> +# On Windows, 'pwd' returns a path like 'D:/foo/bar'. Prepend '/' to turn
> +# it into '/D:/foo/bar', which is what git expects in file:// URLs on Windows.
> +# On Unix, the path already starts with '/', so this is a no-op.
> +pwd_path=$(pwd)
> +case "$pwd_path" in
> +[a-zA-Z]:*) pwd_path="/$pwd_path" ;;
> +esac
> +PWD_URL="file://$pwd_path"
> +# Same as PWD_URL but with spaces percent-encoded, for use in URL patterns.
> +ENCODED_PWD_URL="file://$(echo "$pwd_path" | sed "s/ /%20/g")"Can't we do this unconditionally on all platforms? "file:////foobar" should be valid on Unix systems, too, shouldn't it?
Patrick