Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: [PATCH] test: some testcases failed if cwd is on a symlink

From: Pete Wyckoff <hidden>
Date: 2016-06-15 22:54:19

worldhello.net@gmail.com wrote on Tue, 24 Jul 2012 16:00 +0800:
Run command 'git rev-parse --git-dir' under subdir will return realpath
of '.git' directory. Some test scripts compare this realpath against
"$TRASH_DIRECTORY", they are not equal if current working directory is
on a symlink.

In this fix, get realpath of "$TRASH_DIRECTORY", store it in
"$TRASH_REALPATH" variable, and use it when necessary.
We have the same problem with p4.  I fixed it in t98* in
23bd0c9 (git p4 test: use real_path to resolve p4 client
symlinks, 2012-06-27), but maybe an exported
TRASH_DIRECTORY_REAL_PATH might be generally useful.
+TRASH_REALPATH="$(cd "$TRASH_DIRECTORY"; pwd -P)"
There's a portable test helper that does this already:

    path=$(test-path-utils real_path "$path")

		-- Pete
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help