(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description) op: Equal rhs: { (SQ <'Test submodules config cache infrastructure\n'> <'\n'> <'This test verifies that parsing .gitmodules configurations directly\n'> <'from the database and from the worktree works.\n'> ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:TEST_NO_CREATE_REPO) op:Equal rhs:{(1)})] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ <'submodule config cache setup'>)} { (SQ <'\n'> <'\tmkdir submodule &&\n'> <'\t(cd submodule &&\n'> <'\t\tgit init &&\n'> <'\t\techo a >a &&\n'> <'\t\tgit add . &&\n'> <'\t\tgit commit -ma\n'> <'\t) &&\n'> <'\tmkdir super &&\n'> <'\t(cd super &&\n'> <'\t\tgit init &&\n'> <'\t\tgit submodule add ../submodule &&\n'> <'\t\tgit submodule add ../submodule a &&\n'> <'\t\tgit commit -m "add as submodule and as a" &&\n'> <'\t\tgit mv a b &&\n'> <'\t\tgit commit -m "move a to b"\n'> <'\t)\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(super/expect)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 70 stdin_parts: [ ("Submodule name: 'a' for path 'a'\n") ("Submodule name: 'a' for path 'b'\n") ("Submodule name: 'submodule' for path 'submodule'\n") ("Submodule name: 'submodule' for path 'submodule'\n") ] ) ] ) (C {(test_expect_success)} {(SQ <'test parsing and lookup of submodule config by path'>)} { (SQ <'\n'> <'\t(cd super &&\n'> <'\t\ttest-submodule-config \\\n'> <'\t\t\tHEAD^ a \\\n'> <'\t\t\tHEAD b \\\n'> <'\t\t\tHEAD^ submodule \\\n'> <'\t\t\tHEAD submodule \\\n'> <'\t\t\t\t>actual &&\n'> <'\t\ttest_cmp expect actual\n'> <'\t)\n'> ) } ) (C {(test_expect_success)} {(SQ <'test parsing and lookup of submodule config by name'>)} { (SQ <'\n'> <'\t(cd super &&\n'> <'\t\ttest-submodule-config --name \\\n'> <'\t\t\tHEAD^ a \\\n'> <'\t\t\tHEAD a \\\n'> <'\t\t\tHEAD^ submodule \\\n'> <'\t\t\tHEAD submodule \\\n'> <'\t\t\t\t>actual &&\n'> <'\t\ttest_cmp expect actual\n'> <'\t)\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(super/expect_error)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 123 stdin_parts: [ ("Submodule name: 'a' for path 'b'\n") ("Submodule name: 'submodule' for path 'submodule'\n") ] ) ] ) (C {(test_expect_success)} {(SQ <'error in one submodule config lets continue'>)} { (SQ <'\n'> <'\t(cd super &&\n'> <'\t\tcp .gitmodules .gitmodules.bak &&\n'> <'\t\techo "\tvalue = \\"" >>.gitmodules &&\n'> <'\t\tgit add .gitmodules &&\n'> <'\t\tmv .gitmodules.bak .gitmodules &&\n'> <'\t\tgit commit -m "add error" &&\n'> <'\t\ttest-submodule-config \\\n'> <'\t\t\tHEAD b \\\n'> <'\t\t\tHEAD submodule \\\n'> <'\t\t\t\t>actual &&\n'> <'\t\ttest_cmp expect_error actual\n'> <'\t)\n'> ) } ) (C {(test_expect_success)} {(SQ <'error message contains blob reference'>)} { (SQ <'\n'> <'\t(cd super &&\n'> <'\t\tsha1=$(git rev-parse HEAD) &&\n'> <'\t\ttest-submodule-config \\\n'> <'\t\t\tHEAD b \\\n'> <'\t\t\tHEAD submodule \\\n'> <'\t\t\t\t2>actual_err &&\n'> <'\t\ttest_i18ngrep "submodule-blob $sha1:.gitmodules" actual_err >/dev/null\n'> <'\t)\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(super/expect_url)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 178 stdin_parts: [ ("Submodule url: 'git@somewhere.else.net:a.git' for path 'b'\n") ("Submodule url: 'git@somewhere.else.net:submodule.git' for path 'submodule'\n") ] ) ] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(super/expect_local_path)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 191 stdin_parts: [ ("Submodule name: 'a' for path 'c'\n") ("Submodule name: 'submodule' for path 'submodule'\n") ] ) ] ) (C {(test_expect_success)} {(SQ <'reading of local configuration'>)} { (SQ <'\n'> <'\t(cd super &&\n'> <'\t\told_a=$(git config submodule.a.url) &&\n'> <'\t\told_submodule=$(git config submodule.submodule.url) &&\n'> <'\t\tgit config submodule.a.url git@somewhere.else.net:a.git &&\n'> <'\t\tgit config submodule.submodule.url git@somewhere.else.net:submodule.git &&\n'> <'\t\ttest-submodule-config --url \\\n'> <'\t\t\t"" b \\\n'> <'\t\t\t"" submodule \\\n'> <'\t\t\t\t>actual &&\n'> <'\t\ttest_cmp expect_url actual &&\n'> <'\t\tgit config submodule.a.path c &&\n'> <'\t\ttest-submodule-config \\\n'> <'\t\t\t"" c \\\n'> <'\t\t\t"" submodule \\\n'> <'\t\t\t\t>actual &&\n'> <'\t\ttest_cmp expect_local_path actual &&\n'> <'\t\tgit config submodule.a.url $old_a &&\n'> <'\t\tgit config submodule.submodule.url $old_submodule &&\n'> <'\t\tgit config --unset submodule.a.path c\n'> <'\t)\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(super/expect_fetchrecurse_die.err)} ) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 234 stdin_parts: [('fatal: bad submodule.submodule.fetchrecursesubmodules argument: blabla\n')] ) ] ) (C {(test_expect_success)} {(SQ <'local error in fetchrecursesubmodule dies early'>)} { (SQ <'\n'> <'\t(cd super &&\n'> <'\t\tgit config submodule.submodule.fetchrecursesubmodules blabla &&\n'> <'\t\ttest_must_fail test-submodule-config \\\n'> <'\t\t\t"" b \\\n'> <'\t\t\t"" submodule \\\n'> <'\t\t\t\t>actual.out 2>actual.err &&\n'> <'\t\ttouch expect_fetchrecurse_die.out &&\n'> <'\t\ttest_cmp expect_fetchrecurse_die.out actual.out &&\n'> <'\t\ttest_cmp expect_fetchrecurse_die.err actual.err &&\n'> <'\t\tgit config --unset submodule.submodule.fetchrecursesubmodules\n'> <'\t)\n'> ) } ) (C {(test_expect_success)} {(SQ <'error in history in fetchrecursesubmodule lets continue'>)} { (SQ <'\n'> <'\t(cd super &&\n'> <'\t\tgit config -f .gitmodules \\\n'> <'\t\t\tsubmodule.submodule.fetchrecursesubmodules blabla &&\n'> <'\t\tgit add .gitmodules &&\n'> <'\t\tgit config --unset -f .gitmodules \\\n'> <'\t\t\tsubmodule.submodule.fetchrecursesubmodules &&\n'> <'\t\tgit commit -m "add error in fetchrecursesubmodules" &&\n'> <'\t\ttest-submodule-config \\\n'> <'\t\t\tHEAD b \\\n'> <'\t\t\tHEAD submodule \\\n'> <'\t\t\t\t>actual &&\n'> <'\t\ttest_cmp expect_error actual &&\n'> <'\t\tgit reset --hard HEAD^\n'> <'\t)\n'> ) } ) (C {(test_done)}) ] )