(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description) op: Equal rhs: { (SQ <'Test for submodule diff on non-checked out submodule\n'> <'\n'> <'This test tries to verify that add_submodule_odb works when the submodule was\n'> <'initialized previously but the checkout has since been removed.\n'> ) } ) ] ) (C {(.)} {(./test-lib.sh)}) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:test_encoding) op:Equal rhs:{(DQ (ISO8859-1))})] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:added) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(printf)} {(DQ (hinzugef) (Lit_Other '\\') (303) (Lit_Other '\\') (274gt))}) ] ) left_token: <Left_CommandSub '$('> ) } ) ] ) (command.FuncDef name: add_file body: (command.BraceGroup children: [ (command.Subshell command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(cd)} {(DQ ($ VSub_Number '$1'))}) (C {(shift)}) (command.ForEach iter_name: name do_arg_iter: T body: (command.DoGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (command.SimpleCommand words: [{(echo)} {(DQ ($ VSub_DollarName '$name'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$name'))} ) ] ) (C {(git)} {(add)} {(DQ ($ VSub_DollarName '$name'))}) (C {(test_tick)}) (command.Pipeline children: [ (C {(echo)} { (DQ ('Add ') ($ VSub_DollarName '$name') (' (') ($ VSub_DollarName '$added') (' ') ($ VSub_DollarName '$name') (')') ) } ) (C {(iconv)} {(-f)} {(utf-8)} {(-t)} {($ VSub_DollarName '$test_encoding')} ) (C {(git)} {(-c)} { (DQ ('i18n.commitEncoding=') ($ VSub_DollarName '$test_encoding') ) } {(commit)} {(-F)} {(-)} ) ] negated: F ) ] ) ] ) redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) (C {(git)} {(rev-parse)} {(--short)} {(--verify)} {(HEAD)}) ] ) ] ) ) ] ) ) (command.FuncDef name: commit_file body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test_tick)}) (command.SimpleCommand words: [ {(git)} {(commit)} {(DQ ($ VSub_At '$@'))} {(-m)} {(DQ ('Commit ') ($ VSub_Star '$*'))} ] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] ) ] ) ] ) ) (C {(test_expect_success)} {(SQ <'setup - submodules'>)} { (SQ <'\n'> <'\ttest_create_repo sm2 &&\n'> <'\tadd_file . foo &&\n'> <'\tadd_file sm2 foo1 foo2 &&\n'> <'\tsmhead1=$(git -C sm2 rev-parse --short --verify HEAD)\n'> ) } ) (C {(test_expect_success)} {(SQ <'setup - git submodule add'>)} { (SQ <'\n'> <'\tgit submodule add ./sm2 sm1 &&\n'> <'\tcommit_file sm1 .gitmodules &&\n'> <'\tgit diff-tree -p --no-commit-id --submodule=log HEAD -- sm1 >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 0000000...$smhead1 (new submodule)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'submodule directory removed'>)} { (SQ <'\n'> <'\trm -rf sm1 &&\n'> <'\tgit diff-tree -p --no-commit-id --submodule=log HEAD -- sm1 >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 0000000...$smhead1 (new submodule)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'setup - submodule multiple commits'>)} { (SQ <'\n'> <'\tgit submodule update --checkout sm1 &&\n'> <'\tsmhead2=$(add_file sm1 foo3 foo4) &&\n'> <'\tcommit_file sm1 &&\n'> <'\tgit diff-tree -p --no-commit-id --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $smhead1..$smhead2:\n'> <'\t > Add foo4 ($added foo4)\n'> <'\t > Add foo3 ($added foo3)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'submodule removed multiple commits'>)} { (SQ <'\n'> <'\trm -rf sm1 &&\n'> <'\tgit diff-tree -p --no-commit-id --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $smhead1..$smhead2:\n'> <'\t > Add foo4 ($added foo4)\n'> <'\t > Add foo3 ($added foo3)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'submodule not initialized in new clone'>)} { (SQ <'\n'> <'\tgit clone . sm3 &&\n'> <'\tgit -C sm3 diff-tree -p --no-commit-id --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $smhead1...$smhead2 (not initialized)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'setup submodule moved'>)} { (SQ <'\n'> <'\tgit submodule update --checkout sm1 &&\n'> <'\tgit mv sm1 sm4 &&\n'> <'\tcommit_file sm4 &&\n'> <'\tgit diff-tree -p --no-commit-id --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm4 0000000...$smhead2 (new submodule)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'submodule moved then removed'>)} { (SQ <'\n'> <'\tsmhead3=$(add_file sm4 foo6 foo7) &&\n'> <'\tcommit_file sm4 &&\n'> <'\trm -rf sm4 &&\n'> <'\tgit diff-tree -p --no-commit-id --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm4 $smhead2..$smhead3:\n'> <'\t > Add foo7 ($added foo7)\n'> <'\t > Add foo6 ($added foo6)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_done)}) ] )