Skip to content

Commit 57526fd

Browse files
Pete Wyckoffgitster
authored andcommitted
git-p4: test for absolute PWD problem
Signed-off-by: Pete Wyckoff <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bf1d68f commit 57526fd

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

t/t9808-chdir.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/sh
2+
3+
test_description='git-p4 relative chdir'
4+
5+
. ./lib-git-p4.sh
6+
7+
test_expect_success 'start p4d' '
8+
start_p4d
9+
'
10+
11+
test_expect_success 'init depot' '
12+
(
13+
cd "$cli" &&
14+
echo file1 >file1 &&
15+
p4 add file1 &&
16+
p4 submit -d "change 1"
17+
)
18+
'
19+
20+
# P4 reads from P4CONFIG file to find its server params, if the
21+
# environment variable is set
22+
test_expect_success 'P4CONFIG and absolute dir clone' '
23+
printf "P4PORT=$P4PORT\nP4CLIENT=$P4CLIENT\n" >p4config &&
24+
test_when_finished "rm \"$TRASH_DIRECTORY/p4config\"" &&
25+
test_when_finished cleanup_git &&
26+
(
27+
P4CONFIG=p4config && export P4CONFIG &&
28+
unset P4PORT P4CLIENT &&
29+
"$GITP4" clone --verbose --dest="$git" //depot
30+
)
31+
'
32+
33+
# same thing, but with relative directory name, note missing $ on --dest
34+
test_expect_success 'P4CONFIG and relative dir clone' '
35+
printf "P4PORT=$P4PORT\nP4CLIENT=$P4CLIENT\n" >p4config &&
36+
test_when_finished "rm \"$TRASH_DIRECTORY/p4config\"" &&
37+
test_when_finished cleanup_git &&
38+
(
39+
P4CONFIG=p4config && export P4CONFIG &&
40+
unset P4PORT P4CLIENT &&
41+
"$GITP4" clone --verbose --dest="git" //depot
42+
)
43+
'
44+
45+
test_expect_success 'kill p4d' '
46+
kill_p4d
47+
'
48+
49+
test_done

0 commit comments

Comments
 (0)