(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description) op: assign_op.Equal rhs: {(SQ <'Clone repositories with path case variations'>)} spids: [4] ) ] redirects: [] ) (C {<.>} {<'./lib-git-p4.sh'>}) (C {<test_expect_success>} {(SQ <'start p4d with case folding enabled'>)} {(SQ <'\n'> <'\tstart_p4d -C1\n'>)} ) (C {<test_expect_success>} {(SQ <'Create a repo with path case variations'>)} { (SQ <'\n'> <'\tclient_view "//depot/... //client/..." &&\n'> <'\t(\n'> <'\t\tcd "$cli" &&\n'> <'\n'> <'\t\tmkdir -p Path/to &&\n'> <'\t\t>Path/to/File2.txt &&\n'> <'\t\tp4 add Path/to/File2.txt &&\n'> <'\t\tp4 submit -d "Add file2" &&\n'> <'\t\trm -rf Path &&\n'> <'\n'> <'\t\tmkdir -p path/TO &&\n'> <'\t\t>path/TO/file1.txt &&\n'> <'\t\tp4 add path/TO/file1.txt &&\n'> <'\t\tp4 submit -d "Add file1" &&\n'> <'\t\trm -rf path &&\n'> <'\n'> <'\t\tmkdir -p path/to &&\n'> <'\t\t>path/to/file3.txt &&\n'> <'\t\tp4 add path/to/file3.txt &&\n'> <'\t\tp4 submit -d "Add file3" &&\n'> <'\t\trm -rf path &&\n'> <'\n'> <'\t\tmkdir -p x-outside-spec &&\n'> <'\t\t>x-outside-spec/file4.txt &&\n'> <'\t\tp4 add x-outside-spec/file4.txt &&\n'> <'\t\tp4 submit -d "Add file4" &&\n'> <'\t\trm -rf x-outside-spec\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'Clone root'>)} { (SQ <'\n'> <'\tclient_view "//depot/... //client/..." &&\n'> <'\ttest_when_finished cleanup_git &&\n'> <'\t(\n'> <'\t\tcd "$git" &&\n'> <'\t\tgit init . &&\n'> <'\t\tgit config core.ignorecase false &&\n'> <'\t\tgit p4 clone --use-client-spec --destination="$git" //depot &&\n'> <'\t\t# This method is used instead of "test -f" to ensure the case is\n'> <'\t\t# checked even if the test is executed on case-insensitive file systems.\n'> <'\t\t# All files are there as expected although the path cases look random.\n'> <'\t\tcat >expect <<-\\EOF &&\n'> <'\t\tPath/to/File2.txt\n'> <'\t\tpath/TO/file1.txt\n'> <'\t\tpath/to/file3.txt\n'> <'\t\tx-outside-spec/file4.txt\n'> <'\t\tEOF\n'> <'\t\tgit ls-files >actual &&\n'> <'\t\ttest_cmp expect actual\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'Clone root (ignorecase)'>)} { (SQ <'\n'> <'\tclient_view "//depot/... //client/..." &&\n'> <'\ttest_when_finished cleanup_git &&\n'> <'\t(\n'> <'\t\tcd "$git" &&\n'> <'\t\tgit init . &&\n'> <'\t\tgit config core.ignorecase true &&\n'> <'\t\tgit p4 clone --use-client-spec --destination="$git" //depot &&\n'> <'\t\t# This method is used instead of "test -f" to ensure the case is\n'> <'\t\t# checked even if the test is executed on case-insensitive file systems.\n'> <'\t\t# All files are there as expected although the path cases look random.\n'> <'\t\tcat >expect <<-\\EOF &&\n'> <'\t\tpath/TO/File2.txt\n'> <'\t\tpath/TO/file1.txt\n'> <'\t\tpath/TO/file3.txt\n'> <'\t\tx-outside-spec/file4.txt\n'> <'\t\tEOF\n'> <'\t\tgit ls-files >actual &&\n'> <'\t\ttest_cmp expect actual\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'Clone root and ignore one file'>)} { (SQ <'\n'> <'\tclient_view \\\n'> <'\t\t"//depot/... //client/..." \\\n'> <'\t\t"-//depot/path/TO/file1.txt //client/path/TO/file1.txt" &&\n'> <'\ttest_when_finished cleanup_git &&\n'> <'\t(\n'> <'\t\tcd "$git" &&\n'> <'\t\tgit init . &&\n'> <'\t\tgit config core.ignorecase false &&\n'> <'\t\tgit p4 clone --use-client-spec --destination="$git" //depot &&\n'> <'\t\t# We ignore one file in the client spec and all path cases change from\n'> <'\t\t# "TO" to "to"!\n'> <'\t\tcat >expect <<-\\EOF &&\n'> <'\t\tPath/to/File2.txt\n'> <'\t\tpath/to/file3.txt\n'> <'\t\tx-outside-spec/file4.txt\n'> <'\t\tEOF\n'> <'\t\tgit ls-files >actual &&\n'> <'\t\ttest_cmp expect actual\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'Clone root and ignore one file (ignorecase)'>)} { (SQ <'\n'> <'\tclient_view \\\n'> <'\t\t"//depot/... //client/..." \\\n'> <'\t\t"-//depot/path/TO/file1.txt //client/path/TO/file1.txt" &&\n'> <'\ttest_when_finished cleanup_git &&\n'> <'\t(\n'> <'\t\tcd "$git" &&\n'> <'\t\tgit init . &&\n'> <'\t\tgit config core.ignorecase true &&\n'> <'\t\tgit p4 clone --use-client-spec --destination="$git" //depot &&\n'> <'\t\t# We ignore one file in the client spec and all path cases change from\n'> <'\t\t# "TO" to "to"!\n'> <'\t\tcat >expect <<-\\EOF &&\n'> <'\t\tPath/to/File2.txt\n'> <'\t\tPath/to/file3.txt\n'> <'\t\tx-outside-spec/file4.txt\n'> <'\t\tEOF\n'> <'\t\tgit ls-files >actual &&\n'> <'\t\ttest_cmp expect actual\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'Clone path'>)} { (SQ <'\n'> <'\tclient_view "//depot/Path/... //client/..." &&\n'> <'\ttest_when_finished cleanup_git &&\n'> <'\t(\n'> <'\t\tcd "$git" &&\n'> <'\t\tgit init . &&\n'> <'\t\tgit config core.ignorecase false &&\n'> <'\t\tgit p4 clone --use-client-spec --destination="$git" //depot &&\n'> <'\t\tcat >expect <<-\\EOF &&\n'> <'\t\tto/File2.txt\n'> <'\t\tEOF\n'> <'\t\tgit ls-files >actual &&\n'> <'\t\ttest_cmp expect actual\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'Clone path (ignorecase)'>)} { (SQ <'\n'> <'\tclient_view "//depot/Path/... //client/..." &&\n'> <'\ttest_when_finished cleanup_git &&\n'> <'\t(\n'> <'\t\tcd "$git" &&\n'> <'\t\tgit init . &&\n'> <'\t\tgit config core.ignorecase true &&\n'> <'\t\tgit p4 clone --use-client-spec --destination="$git" //depot &&\n'> <'\t\tcat >expect <<-\\EOF &&\n'> <'\t\tTO/File2.txt\n'> <'\t\tTO/file1.txt\n'> <'\t\tTO/file3.txt\n'> <'\t\tEOF\n'> <'\t\tgit ls-files >actual &&\n'> <'\t\ttest_cmp expect actual\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'Add a new file and clone path with new file (ignorecase)'>)} { (SQ <'\n'> <'\tclient_view "//depot/... //client/..." &&\n'> <'\t(\n'> <'\t\tcd "$cli" &&\n'> <'\t\tmkdir -p Path/to &&\n'> <'\t\t>Path/to/File0.txt &&\n'> <'\t\tp4 add Path/to/File0.txt &&\n'> <'\t\tp4 submit -d "Add file" &&\n'> <'\t\trm -rf Path\n'> <'\t) &&\n'> <'\n'> <'\tclient_view "//depot/Path/... //client/..." &&\n'> <'\ttest_when_finished cleanup_git &&\n'> <'\t(\n'> <'\t\tcd "$git" &&\n'> <'\t\tgit init . &&\n'> <'\t\tgit config core.ignorecase true &&\n'> <'\t\tgit p4 clone --use-client-spec --destination="$git" //depot &&\n'> <'\t\tcat >expect <<-\\EOF &&\n'> <'\t\tto/File0.txt\n'> <'\t\tto/File2.txt\n'> <'\t\tto/file1.txt\n'> <'\t\tto/file3.txt\n'> <'\t\tEOF\n'> <'\t\tgit ls-files >actual &&\n'> <'\t\ttest_cmp expect actual\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'kill p4d'>)} {(SQ <'\n'> <'\tkill_p4d\n'>)}) (C {<test_done>}) ] )