From: Patrick Steinhardt Date: Thu, 26 Mar 2026 12:21:27 GMT Subject: Re: [PATCH 12/16] t5710: use proper file:// URIs for absolute paths Message-ID: In-Reply-To: <20260323080520.887550-13-christian.couder@gmail.com> 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