git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/3] test: use unambigous leading path (/foo) for mingw

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 13, 2013, 19:51 UTC
Message-ID
<xmqqtxhoijpz.fsf@gitster.dls.corp.google.com>
In-Reply-To
<6533cbb59cd4de1d616ef62898f64a5cd144a561.1379048276.git.worldhello.net@gmail.com>
Jiang Xin <worldhello.net@gmail.com> writes:
> In test cases for relative_path, path with one leading character
> (such as /a, /x) may be recogonized as "a:/" or "x:/" if there is
> such doc drive on MINGW platform. Use an umambigous leading path
> "/foo" instead.
"DOS drive", you mean?
Are they really spelled as /a or /x (not e.g. //a or something)?
Just double-checking.
Show 71 quoted lines
> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
> ---
>  t/t0060-path-utils.sh | 56 +++++++++++++++++++++++++--------------------------
>  1 file changed, 28 insertions(+), 28 deletions(-)
>
> diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh
> index 3a48de2..82a6f21 100755
> --- a/t/t0060-path-utils.sh
> +++ b/t/t0060-path-utils.sh
> @@ -190,33 +190,33 @@ test_expect_success SYMLINKS 'real path works on symlinks' '
>  	test "$sym" = "$(test-path-utils real_path "$dir2/syml")"
>  '
>  
> -relative_path /a/b/c/	/a/b/		c/
> -relative_path /a/b/c/	/a/b		c/
> -relative_path /a//b//c/	//a/b//		c/	POSIX
> -relative_path /a/b	/a/b		./
> -relative_path /a/b/	/a/b		./
> -relative_path /a	/a/b		../
> -relative_path /		/a/b/		../../
> -relative_path /a/c	/a/b/		../c
> -relative_path /a/c	/a/b		../c
> -relative_path /x/y	/a/b/		../../x/y
> -relative_path /a/b	"<empty>"	/a/b
> -relative_path /a/b 	"<null>"	/a/b
> -relative_path a/b/c/	a/b/		c/
> -relative_path a/b/c/	a/b		c/
> -relative_path a/b//c	a//b		c
> -relative_path a/b/	a/b/		./
> -relative_path a/b/	a/b		./
> -relative_path a		a/b		../
> -relative_path x/y	a/b		../../x/y
> -relative_path a/c	a/b		../c
> -relative_path a/b	"<empty>"	a/b
> -relative_path a/b 	"<null>"	a/b
> -relative_path "<empty>"	/a/b		./
> -relative_path "<empty>"	"<empty>"	./
> -relative_path "<empty>"	"<null>"	./
> -relative_path "<null>"	"<empty>"	./
> -relative_path "<null>"	"<null>"	./
> -relative_path "<null>"	/a/b		./
> +relative_path /foo/a/b/c/	/foo/a/b/	c/
> +relative_path /foo/a/b/c/	/foo/a/b	c/
> +relative_path /foo/a//b//c/	//foo/a/b//	c/		POSIX
> +relative_path /foo/a/b		/foo/a/b	./
> +relative_path /foo/a/b/		/foo/a/b	./
> +relative_path /foo/a		/foo/a/b	../
> +relative_path /			/foo/a/b/	../../../
> +relative_path /foo/a/c		/foo/a/b/	../c
> +relative_path /foo/a/c		/foo/a/b	../c
> +relative_path /foo/x/y		/foo/a/b/	../../x/y
> +relative_path /foo/a/b		"<empty>"	/foo/a/b
> +relative_path /foo/a/b 		"<null>"	/foo/a/b
> +relative_path foo/a/b/c/	foo/a/b/	c/
> +relative_path foo/a/b/c/	foo/a/b		c/
> +relative_path foo/a/b//c	foo/a//b	c
> +relative_path foo/a/b/		foo/a/b/	./
> +relative_path foo/a/b/		foo/a/b		./
> +relative_path foo/a		foo/a/b		../
> +relative_path foo/x/y		foo/a/b		../../x/y
> +relative_path foo/a/c		foo/a/b		../c
> +relative_path foo/a/b		"<empty>"	foo/a/b
> +relative_path foo/a/b 		"<null>"	foo/a/b
> +relative_path "<empty>"		/foo/a/b	./
> +relative_path "<empty>"		"<empty>"	./
> +relative_path "<empty>"		"<null>"	./
> +relative_path "<null>"		"<empty>"	./
> +relative_path "<null>"		"<null>"	./
> +relative_path "<null>"		/foo/a/b	./
>  
>  test_done
Previous: Jiang XinNext: Torsten Bögershausen
Message 3 of 8 in “fixes for relative_path”
  1. 0/3 fixes for relative_pathJiang Xin, Sep 13, 2013
  2. 1/3 test: use unambigous leading path (/foo) for mingwJiang Xin, Sep 13, 2013
  3. Junio C HamanoSep 13, 2013
  4. Torsten BögershausenSep 14, 2013
  5. Junio C HamanoSep 17, 2013
  6. 2/3 relative_path should honor dos_drive_prefixJiang Xin, Sep 13, 2013
  7. Torsten BögershausenSep 14, 2013
  8. 3/3 Use simpler relative_path when set_git_dirJiang Xin, Sep 13, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.