summaryrefslogtreecommitdiff
path: root/t/t9806-git-p4-options.sh
diff options
context:
space:
mode:
authorPete Wyckoff <pw@padd.com>2013-01-27 03:11:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-01-27 06:00:38 (GMT)
commit50038ba92a22743be8c105e16fb559a6d96c3a7a (patch)
tree3c50888c8c7b3f666ec7c703816b8409dbd530e5 /t/t9806-git-p4-options.sh
parent6112541b444b52d5ac83f491eabefbf571da4997 (diff)
downloadgit-50038ba92a22743be8c105e16fb559a6d96c3a7a.zip
git-50038ba92a22743be8c105e16fb559a6d96c3a7a.tar.gz
git-50038ba92a22743be8c105e16fb559a6d96c3a7a.tar.bz2
git p4 test: use client_view in t9806
Use the standard client_view function from lib-git-p4.sh instead of building one by hand. This requires a bit of rework, using the current value of $P4CLIENT for the client name. It also reorganizes the test to isolate changes to $P4CLIENT and $cli in a subshell. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9806-git-p4-options.sh')
-rwxr-xr-xt/t9806-git-p4-options.sh49
1 files changed, 21 insertions, 28 deletions
diff --git a/t/t9806-git-p4-options.sh b/t/t9806-git-p4-options.sh
index 4f077ee..564fc80 100755
--- a/t/t9806-git-p4-options.sh
+++ b/t/t9806-git-p4-options.sh
@@ -214,40 +214,33 @@ test_expect_success 'clone --use-client-spec' '
exec >/dev/null &&
test_must_fail git p4 clone --dest="$git" --use-client-spec
) &&
+ # build a different client
cli2=$(test-path-utils real_path "$TRASH_DIRECTORY/cli2") &&
mkdir -p "$cli2" &&
test_when_finished "rmdir \"$cli2\"" &&
- (
- cd "$cli2" &&
- p4 client -i <<-EOF
- Client: client2
- Description: client2
- Root: $cli2
- View: //depot/sub/... //client2/bus/...
- EOF
- ) &&
test_when_finished cleanup_git &&
(
+ # group P4CLIENT and cli changes in a sub-shell
P4CLIENT=client2 &&
- git p4 clone --dest="$git" --use-client-spec //depot/...
- ) &&
- (
- cd "$git" &&
- test_path_is_file bus/dir/f4 &&
- test_path_is_missing file1
- ) &&
- cleanup_git &&
-
- # same thing again, this time with variable instead of option
- (
- cd "$git" &&
- git init &&
- git config git-p4.useClientSpec true &&
- P4CLIENT=client2 &&
- git p4 sync //depot/... &&
- git checkout -b master p4/master &&
- test_path_is_file bus/dir/f4 &&
- test_path_is_missing file1
+ cli="$cli2" &&
+ client_view "//depot/sub/... //client2/bus/..." &&
+ git p4 clone --dest="$git" --use-client-spec //depot/... &&
+ (
+ cd "$git" &&
+ test_path_is_file bus/dir/f4 &&
+ test_path_is_missing file1
+ ) &&
+ cleanup_git &&
+ # same thing again, this time with variable instead of option
+ (
+ cd "$git" &&
+ git init &&
+ git config git-p4.useClientSpec true &&
+ git p4 sync //depot/... &&
+ git checkout -b master p4/master &&
+ test_path_is_file bus/dir/f4 &&
+ test_path_is_missing file1
+ )
)
'