Skip to content

Commit 23bd0c9

Browse files
Pete Wyckoffgitster
authored andcommitted
git p4 test: use real_path to resolve p4 client symlinks
The p4 program is finicky about making sure the recorded client Root matches the current working directory. The way it discovers the latter seems to be to inspect shell variable $PWD. This could involve symlinks, that while leading to the same place as the client Root, look different, and cause p4 to fail. Resolve all client paths using "test-path-utils real_path $path". This removes ".." and resolves all symlinks. Discovered while running with --root=/dev/shm, which is a link to /run/shm. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent f89f35a commit 23bd0c9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

t/lib-git-p4.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export P4CLIENT=client
2727
export P4EDITOR=:
2828

2929
db="$TRASH_DIRECTORY/db"
30-
cli="$TRASH_DIRECTORY/cli"
30+
cli=$(test-path-utils real_path "$TRASH_DIRECTORY/cli")
3131
git="$TRASH_DIRECTORY/git"
3232
pidfile="$TRASH_DIRECTORY/p4d.pid"
3333

t/t9806-git-p4-options.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ test_expect_success 'clone --use-client-spec' '
128128
exec >/dev/null &&
129129
test_must_fail git p4 clone --dest="$git" --use-client-spec
130130
) &&
131-
cli2="$TRASH_DIRECTORY/cli2" &&
131+
cli2=$(test-path-utils real_path "$TRASH_DIRECTORY/cli2") &&
132132
mkdir -p "$cli2" &&
133133
test_when_finished "rmdir \"$cli2\"" &&
134134
(

t/t9810-git-p4-rcs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ test_expect_success 'cope with rcs keyword expansion damage' '
244244
cd "$git" &&
245245
git config git-p4.skipSubmitEdit true &&
246246
git config git-p4.attemptRCSCleanup true &&
247-
(cd ../cli && p4_append_to_file kwfile1.c) &&
247+
(cd "$cli" && p4_append_to_file kwfile1.c) &&
248248
old_lines=$(wc -l <kwfile1.c) &&
249249
perl -n -i -e "print unless m/Revision:/" kwfile1.c &&
250250
new_lines=$(wc -l <kwfile1.c) &&

0 commit comments

Comments
 (0)