3 test_description='git p4 tests for excluded paths during clone and sync'
7 test_expect_success 'start p4d' '
11 # Create a repo with the structure:
16 # Check that we can exclude a subdirectory with both
17 # clone and sync operations.
19 test_expect_success 'create exclude repo' '
22 mkdir -p wanted discard &&
23 echo wanted >wanted/foo &&
24 echo discard >discard/foo &&
25 p4 add wanted/foo discard/foo &&
26 p4 submit -d "initial revision"
30 test_expect_success 'check the repo was created correctly' '
31 test_when_finished cleanup_git &&
32 git p4 clone --dest="$git" //depot/...@all &&
35 test_path_is_file wanted/foo &&
36 test_path_is_file discard/foo
40 test_expect_success 'clone, excluding part of repo' '
41 test_when_finished cleanup_git &&
42 git p4 clone -//depot/discard/... --dest="$git" //depot/...@all &&
45 test_path_is_file wanted/foo &&
46 test_path_is_missing discard/foo
50 test_expect_success 'clone, then sync with exclude' '
51 test_when_finished cleanup_git &&
52 git p4 clone -//depot/discard/... --dest="$git" //depot/...@all &&
55 p4 edit wanted/foo discard/foo &&
58 p4 submit -d "updating" &&
61 git p4 sync -//depot/discard/... &&
62 test_path_is_file wanted/foo &&
63 test_path_is_missing discard/foo