(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (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'> ) } spids: [13] ) ] spids: [13] ) (C {(.)} {(./test-lib.sh)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_encoding) op: Equal rhs: {(DQ (ISO8859-1))} spids: [30] ) ] spids: [30] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:added) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(printf)} { (DQ (hinzugef) (EscapedLiteralPart token:<Lit_EscapedChar '\\3'>) (03) (EscapedLiteralPart token: <Lit_EscapedChar '\\2'> ) (74gt) ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [43 53] ) } spids: [42] ) ] spids: [42] ) (FuncDef name: add_file body: (BraceGroup children: [ (Subshell child: (AndOr children: [ (C {(cd)} {(DQ ($ VSub_Number '$1'))}) (AndOr children: [ (C {(shift)}) (AndOr children: [ (ForEach iter_name: name do_arg_iter: True body: (DoGroup children: [ (AndOr children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$name'))}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name '$name'))} spids: [95] ) ] ) (AndOr children: [ (C {(git)} {(add)} {(DQ ($ VSub_Name '$name'))}) (AndOr children: [ (C {(test_tick)}) (Pipeline children: [ (C {(echo)} { (DQ ('Add ') ($ VSub_Name '$name') (' (') ($ VSub_Name '$added') (' ') ($ VSub_Name '$name') (')') ) } ) (C {(iconv)} {(-f)} {(utf-8)} {(-t)} {($ VSub_Name '$test_encoding')} ) (C {(git)} {(-c)} { (DQ ('i18n.commitEncoding=') ($ VSub_Name '$test_encoding') ) } {(commit)} {(-F)} {(-)} ) ] negated: False ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] spids: [86 170] ) redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [172] ) ] spids: [-1 -1] ) (C {(git)} {(rev-parse)} {(--short)} {(--verify)} {(HEAD)}) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) spids: [64 189] ) ] spids: [61] ) spids: [56 60] ) (FuncDef name: commit_file body: (BraceGroup children: [ (AndOr children: [ (C {(test_tick)}) (SimpleCommand words: [ {(git)} {(commit)} {(DQ ($ VSub_At '$@'))} {(-m)} {(DQ ('Commit ') ($ VSub_Star '$*'))} ] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[222])] ) ] op_id: Op_DAmp ) ] spids: [199] ) spids: [194 198] ) (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)}) ] )