Subject: Re: [PATCH 12/16] t5710: use proper file:// URIs for absolute paths

From: Patrick Steinhardt <[email-masked]>
Date: Thu, 26 Mar 2026 13:21:27 +0100

On Mon, Mar 23, 2026 at 09:05:15AM +0100, Christian Couder wrote:
> 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