git-p4: test --keep-path

Make sure it leaves the path, below //depot, in git. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Pete Wyckoff committed Dec 24, 2011 at 21:07 UTC ae3f41f20a0b5a9fa3e83a12557c887855b920f3
1 file changed +24
t/t9806-git-p4-options.sh
+24
@@ -93,6 +93,30 @@ test_expect_success 'clone --max-changes' '
93 )
94 '
95
96 +test_expect_success 'clone --keep-path' '
97 + (
98 + cd "$cli" &&
99 + mkdir -p sub/dir &&
100 + echo f4 >sub/dir/f4 &&
101 + p4 add sub/dir/f4 &&
102 + p4 submit -d "change 4"
103 + ) &&
104 + "$GITP4" clone --dest="$git" --keep-path //depot/sub/dir@all &&
105 + test_when_finished cleanup_git &&
106 + (
107 + cd "$git" &&
108 + test_path_is_missing f4 &&
109 + test_path_is_file sub/dir/f4
110 + ) &&
111 + cleanup_git &&
112 + "$GITP4" clone --dest="$git" //depot/sub/dir@all &&
113 + (
114 + cd "$git" &&
115 + test_path_is_file f4 &&
116 + test_path_is_missing sub/dir/f4
117 + )
118 +'
119 +
120 test_expect_success 'kill p4d' '
121 kill_p4d
122 '