1#!/bin/sh
23
test_description='git p4 tests for excluded paths during clone and sync'
45
. ./lib-git-p4.sh
67
test_expect_success 'start p4d' '
8start_p4d
9'
1011
# Create a repo with the structure:
12#
13# //depot/wanted/foo
14# //depot/discard/foo
15#
16# Check that we can exclude a subdirectory with both
17# clone and sync operations.
1819
test_expect_success 'create exclude repo' '
20(
21cd "$cli" &&
22mkdir -p wanted discard &&
23echo wanted >wanted/foo &&
24echo discard >discard/foo &&
25p4 add wanted/foo discard/foo &&
26p4 submit -d "initial revision"
27)
28'
2930
test_expect_success 'check the repo was created correctly' '
31test_when_finished cleanup_git &&
32git p4 clone --dest="$git" //depot/...@all &&
33(
34cd "$git" &&
35test_path_is_file wanted/foo &&
36test_path_is_file discard/foo
37)
38'
3940
test_expect_success 'clone, excluding part of repo' '
41test_when_finished cleanup_git &&
42git p4 clone -//depot/discard/... --dest="$git" //depot/...@all &&
43(
44cd "$git" &&
45test_path_is_file wanted/foo &&
46test_path_is_missing discard/foo
47)
48'
4950
test_expect_success 'clone, then sync with exclude' '
51test_when_finished cleanup_git &&
52git p4 clone -//depot/discard/... --dest="$git" //depot/...@all &&
53(
54cd "$cli" &&
55p4 edit wanted/foo discard/foo &&
56date >>wanted/foo &&
57date >>discard/foo &&
58p4 submit -d "updating" &&
5960
cd "$git" &&
61git p4 sync -//depot/discard/... &&
62test_path_is_file wanted/foo &&
63test_path_is_missing discard/foo
64)
65'
6667
test_done