summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Wyckoff <pw@padd.com>2013-03-11 21:45:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-03-11 22:02:59 (GMT)
commit89773db3e8ee4fd8f37b3051b6cd202e7bacb56a (patch)
treec660eecff617b1095db31abe9d6c292a340a96ef
parent9e7b8efb9d8fde168fee2c12c57903bbb93fd115 (diff)
downloadgit-89773db3e8ee4fd8f37b3051b6cd202e7bacb56a.zip
git-89773db3e8ee4fd8f37b3051b6cd202e7bacb56a.tar.gz
git-89773db3e8ee4fd8f37b3051b6cd202e7bacb56a.tar.bz2
git p4 test: should honor symlink in p4 client root
This test fails when the p4 client root includes a symlink. It complains: Path /vol/bar/projects/foo/... is not under client root /p/foo and dumps a traceback. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t9808-git-p4-chdir.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t9808-git-p4-chdir.sh b/t/t9808-git-p4-chdir.sh
index 55c5e36..4773296 100755
--- a/t/t9808-git-p4-chdir.sh
+++ b/t/t9808-git-p4-chdir.sh
@@ -56,6 +56,33 @@ test_expect_success 'p4 client root would be relative due to clone --dest' '
)
'
+# When the p4 client Root is a symlink, make sure chdir() does not use
+# getcwd() to convert it to a physical path.
+test_expect_failure SYMLINKS 'p4 client root symlink should stay symbolic' '
+ physical="$TRASH_DIRECTORY/physical" &&
+ symbolic="$TRASH_DIRECTORY/symbolic" &&
+ test_when_finished "rm -rf \"$physical\"" &&
+ test_when_finished "rm \"$symbolic\"" &&
+ mkdir -p "$physical" &&
+ ln -s "$physical" "$symbolic" &&
+ test_when_finished cleanup_git &&
+ (
+ P4CLIENT=client-sym &&
+ p4 client -i <<-EOF &&
+ Client: $P4CLIENT
+ Description: $P4CLIENT
+ Root: $symbolic
+ LineEnd: unix
+ View: //depot/... //$P4CLIENT/...
+ EOF
+ git p4 clone --dest="$git" //depot &&
+ cd "$git" &&
+ test_commit file2 &&
+ git config git-p4.skipSubmitEdit true &&
+ git p4 submit
+ )
+'
+
test_expect_success 'kill p4d' '
kill_p4d
'