(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description spids:[13]) 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 spids:[30]) op: Equal rhs: {(DQ (ISO8859-1))} spids: [30] ) ] spids: [30] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:added spids:[42]) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(printf)} {(DQ (hinzugef) (Lit_Other '\\') (303) (Lit_Other '\\') (274gt))}) ] ) left_token: <Left_CommandSub '$('> spids: [43 53] ) } spids: [42] ) ] spids: [42] ) (FuncDef name: add_file body: (BraceGroup children: [ (Subshell child: (AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(cd)} {(DQ ($ VSub_Number '$1'))}) (C {(shift)}) (ForEach iter_name: name do_arg_iter: T body: (DoGroup children: [ (AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$name'))}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$name'))} ) ] ) (C {(git)} {(add)} {(DQ ($ VSub_Name '$name'))}) (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: F ) ] ) ] spids: [86 170] ) redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] spids: [16777215 16777215] ) (C {(git)} {(rev-parse)} {(--short)} {(--verify)} {(HEAD)}) ] ) spids: [64 189] ) ] spids: [61] ) spids: [56 60] ) (FuncDef name: commit_file body: (BraceGroup children: [ (AndOr ops: [Op_DAmp] children: [ (C {(test_tick)}) (SimpleCommand words: [ {(git)} {(commit)} {(DQ ($ VSub_At '$@'))} {(-m)} {(DQ ('Commit ') ($ VSub_Star '$*'))} ] redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] ) ] ) ] 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)}) ] )