3 test_description
='git p4 tests for excluded paths during clone and sync'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success
'start p4d' '
12 # Create a repo with the structure:
17 # Check that we can exclude a subdirectory with both
18 # clone and sync operations.
20 test_expect_success
'create exclude repo' '
23 mkdir -p wanted discard &&
24 echo wanted >wanted/foo &&
25 echo discard >discard/foo &&
26 echo discard_file >discard_file &&
27 echo discard_file_not >discard_file_not &&
28 p4 add wanted/foo discard/foo discard_file discard_file_not &&
29 p4 submit -d "initial revision"
33 test_expect_success
'check the repo was created correctly' '
34 test_when_finished cleanup_git &&
35 git p4 clone --dest="$git" //depot/...@all &&
38 test_path_is_file wanted/foo &&
39 test_path_is_file discard/foo &&
40 test_path_is_file discard_file &&
41 test_path_is_file discard_file_not
45 test_expect_success
'clone, excluding part of repo' '
46 test_when_finished cleanup_git &&
47 git p4 clone -//depot/discard/... --dest="$git" //depot/...@all &&
50 test_path_is_file wanted/foo &&
51 test_path_is_missing discard/foo &&
52 test_path_is_file discard_file &&
53 test_path_is_file discard_file_not
57 test_expect_success
'clone, excluding single file, no trailing /' '
58 test_when_finished cleanup_git &&
59 git p4 clone -//depot/discard_file --dest="$git" //depot/...@all &&
62 test_path_is_file wanted/foo &&
63 test_path_is_file discard/foo &&
64 test_path_is_missing discard_file &&
65 test_path_is_file discard_file_not
69 test_expect_success
'clone, then sync with exclude' '
70 test_when_finished cleanup_git &&
71 git p4 clone -//depot/discard/... --dest="$git" //depot/...@all &&
74 p4 edit wanted/foo discard/foo discard_file_not &&
77 date >>discard_file_not &&
78 p4 submit -d "updating" &&
81 git p4 sync -//depot/discard/... &&
82 test_path_is_file wanted/foo &&
83 test_path_is_missing discard/foo &&
84 test_path_is_file discard_file &&
85 test_path_is_file discard_file_not
89 test_expect_success
'clone, then sync with exclude, no trailing /' '
90 test_when_finished cleanup_git &&
91 git p4 clone -//depot/discard/... -//depot/discard_file --dest="$git" //depot/...@all &&
94 p4 edit wanted/foo discard/foo discard_file_not &&
97 date >>discard_file_not &&
98 p4 submit -d "updating" &&
101 git p4 sync -//depot/discard/... -//depot/discard_file &&
102 test_path_is_file wanted/foo &&
103 test_path_is_missing discard/foo &&
104 test_path_is_missing discard_file &&
105 test_path_is_file discard_file_not