(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: { (SQ <'Support for diff format verbose submodule difference in git diff\n'> <'\n'> <'This test tries to verify the sanity of --submodule=diff option of git diff.\n'> ) } spids: [19] ) ] spids: [19] ) (C {(.)} {(./test-lib.sh)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_encoding) op: Equal rhs: {(DQ (ISO8859-1))} spids: [35] ) ] spids: [35] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:added) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(printf)} {(DQ (hinzugef) (Lit_Other '\\') (303) (Lit_Other '\\') (274gt))}) ] ) left_token: <Left_CommandSub '$('> spids: [48 58] ) } spids: [47] ) ] spids: [47] ) (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_id: Redir_Great fd: 16777215 arg_word: {(DQ ($ VSub_Name '$name'))} spids: [100] ) ] ) (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: [91 175] ) redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [177] ) ] spids: [16777215 16777215] ) (C {(git)} {(rev-parse)} {(--short)} {(--verify)} {(HEAD)}) ] ) spids: [69 194] ) ] spids: [66] ) spids: [61 65] ) (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_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [227] ) ] ) ] ) ] spids: [204] ) spids: [199 203] ) (C {(test_expect_success)} {(SQ <'setup repository'>)} { (SQ <'\n'> <'\ttest_create_repo sm1 &&\n'> <'\tadd_file . foo &&\n'> <'\thead1=$(add_file sm1 foo1 foo2) &&\n'> <'\tfullhead1=$(git -C sm1 rev-parse --verify HEAD)\n'> ) } ) (C {(test_expect_success)} {(SQ <'added submodule'>)} { (SQ <'\n'> <'\tgit add sm1 &&\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 0000000...$head1 (new submodule)\n'> <'\tdiff --git a/sm1/foo1 b/sm1/foo1\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..1715acd\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1/foo1\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo1\n'> <'\tdiff --git a/sm1/foo2 b/sm1/foo2\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..54b060e\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1/foo2\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo2\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'added submodule, set diff.submodule'>)} { (SQ <'\n'> <'\ttest_config diff.submodule log &&\n'> <'\tgit add sm1 &&\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 0000000...$head1 (new submodule)\n'> <'\tdiff --git a/sm1/foo1 b/sm1/foo1\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..1715acd\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1/foo1\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo1\n'> <'\tdiff --git a/sm1/foo2 b/sm1/foo2\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..54b060e\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1/foo2\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo2\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'--submodule=short overrides diff.submodule'>)} { (SQ <'\n'> <'\ttest_config diff.submodule log &&\n'> <'\tgit add sm1 &&\n'> <'\tgit diff --submodule=short --cached >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tdiff --git a/sm1 b/sm1\n'> <'\tnew file mode 160000\n'> <'\tindex 0000000..$head1\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+Subproject commit $fullhead1\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'diff.submodule does not affect plumbing'>)} { (SQ <'\n'> <'\ttest_config diff.submodule log &&\n'> <'\tgit diff-index -p HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tdiff --git a/sm1 b/sm1\n'> <'\tnew file mode 160000\n'> <'\tindex 0000000..$head1\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+Subproject commit $fullhead1\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (AndOr ops: [Op_DAmp] children: [ (C {(commit_file)} {(sm1)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:head2) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(add_file)} {(sm1)} {(foo3)})]) left_token: <Left_CommandSub '$('> spids: [365 371] ) } spids: [364] ) ] spids: [364] ) ] ) (C {(test_expect_success)} {(SQ <'modified submodule(forward)'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head1..$head2:\n'> <'\tdiff --git a/sm1/foo3 b/sm1/foo3\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..c1ec6c6\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1/foo3\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo3\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'modified submodule(forward)'>)} { (SQ <'\n'> <'\tgit diff --submodule=diff >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head1..$head2:\n'> <'\tdiff --git a/sm1/foo3 b/sm1/foo3\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..c1ec6c6\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1/foo3\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo3\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'modified submodule(forward) --submodule'>)} { (SQ <'\n'> <'\tgit diff --submodule >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head1..$head2:\n'> <'\t > Add foo3 ($added foo3)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:fullhead2) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Sentence child: (C {(cd)} {(sm1)}) terminator: <Op_Semi ';'> ) (C {(git)} {(rev-parse)} {(--verify)} {(HEAD)}) ] ) left_token: <Left_CommandSub '$('> spids: [438 451] ) } spids: [437] ) ] spids: [437] ) (C {(test_expect_success)} {(SQ <'modified submodule(forward) --submodule=short'>)} { (SQ <'\n'> <'\tgit diff --submodule=short >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tdiff --git a/sm1 b/sm1\n'> <'\tindex $head1..$head2 160000\n'> <'\t--- a/sm1\n'> <'\t+++ b/sm1\n'> <'\t@@ -1 +1 @@\n'> <'\t-Subproject commit $fullhead1\n'> <'\t+Subproject commit $fullhead2\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (AndOr ops: [Op_DAmp] children: [ (C {(commit_file)} {(sm1)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:head3) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(cd)} {(sm1)}) (SimpleCommand words: [{(git)} {(reset)} {(--hard)} {(HEAD) (Lit_Tilde '~') (2)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [502] ) ] ) (C {(git)} {(rev-parse)} {(--short)} {(--verify)} {(HEAD)}) ] ) ] ) left_token: <Left_CommandSub '$('> spids: [482 518] ) } spids: [481] ) ] spids: [481] ) ] ) (C {(test_expect_success)} {(SQ <'modified submodule(backward)'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head2..$head3 (rewind):\n'> <'\tdiff --git a/sm1/foo2 b/sm1/foo2\n'> <'\tdeleted file mode 100644\n'> <'\tindex 54b060e..0000000\n'> <'\t--- a/sm1/foo2\n'> <'\t+++ /dev/null\n'> <'\t@@ -1 +0,0 @@\n'> <'\t-foo2\n'> <'\tdiff --git a/sm1/foo3 b/sm1/foo3\n'> <'\tdeleted file mode 100644\n'> <'\tindex c1ec6c6..0000000\n'> <'\t--- a/sm1/foo3\n'> <'\t+++ /dev/null\n'> <'\t@@ -1 +0,0 @@\n'> <'\t-foo3\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:head4) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(add_file)} {(sm1)} {(foo4)} {(foo5)})]) left_token: <Left_CommandSub '$('> spids: [552 560] ) } spids: [551] ) ] spids: [551] ) (C {(test_expect_success)} {(SQ <'modified submodule(backward and forward)'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head2...$head4:\n'> <'\tdiff --git a/sm1/foo2 b/sm1/foo2\n'> <'\tdeleted file mode 100644\n'> <'\tindex 54b060e..0000000\n'> <'\t--- a/sm1/foo2\n'> <'\t+++ /dev/null\n'> <'\t@@ -1 +0,0 @@\n'> <'\t-foo2\n'> <'\tdiff --git a/sm1/foo3 b/sm1/foo3\n'> <'\tdeleted file mode 100644\n'> <'\tindex c1ec6c6..0000000\n'> <'\t--- a/sm1/foo3\n'> <'\t+++ /dev/null\n'> <'\t@@ -1 +0,0 @@\n'> <'\t-foo3\n'> <'\tdiff --git a/sm1/foo4 b/sm1/foo4\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..a0016db\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1/foo4\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo4\n'> <'\tdiff --git a/sm1/foo5 b/sm1/foo5\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..d6f2413\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1/foo5\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo5\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(commit_file)} {(sm1)}) (C {(mv)} {(sm1)} {(sm1-bak)}) (SimpleCommand words: [{(echo)} {(sm1)}] redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(sm1)} spids:[624])] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:head5) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [(C {(git)} {(hash-object)} {(sm1)}) (C {(cut)} {(-c1-7)})] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [630 642] ) } spids: [629] ) ] spids: [629] ) (C {(git)} {(add)} {(sm1)}) (C {(rm)} {(-f)} {(sm1)}) (C {(mv)} {(sm1-bak)} {(sm1)}) ] ) (C {(test_expect_success)} {(SQ <'typechanged submodule(submodule->blob), --cached'>)} { (SQ <'\n'> <'\tgit diff --submodule=diff --cached >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head4...0000000 (submodule deleted)\n'> <'\tdiff --git a/sm1/foo1 b/sm1/foo1\n'> <'\tdeleted file mode 100644\n'> <'\tindex 1715acd..0000000\n'> <'\t--- a/sm1/foo1\n'> <'\t+++ /dev/null\n'> <'\t@@ -1 +0,0 @@\n'> <'\t-foo1\n'> <'\tdiff --git a/sm1/foo4 b/sm1/foo4\n'> <'\tdeleted file mode 100644\n'> <'\tindex a0016db..0000000\n'> <'\t--- a/sm1/foo4\n'> <'\t+++ /dev/null\n'> <'\t@@ -1 +0,0 @@\n'> <'\t-foo4\n'> <'\tdiff --git a/sm1/foo5 b/sm1/foo5\n'> <'\tdeleted file mode 100644\n'> <'\tindex d6f2413..0000000\n'> <'\t--- a/sm1/foo5\n'> <'\t+++ /dev/null\n'> <'\t@@ -1 +0,0 @@\n'> <'\t-foo5\n'> <'\tdiff --git a/sm1 b/sm1\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..9da5fb8\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+sm1\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'typechanged submodule(submodule->blob)'>)} { (SQ <'\n'> <'\tgit diff --submodule=diff >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tdiff --git a/sm1 b/sm1\n'> <'\tdeleted file mode 100644\n'> <'\tindex 9da5fb8..0000000\n'> <'\t--- a/sm1\n'> <'\t+++ /dev/null\n'> <'\t@@ -1 +0,0 @@\n'> <'\t-sm1\n'> <'\tSubmodule sm1 0000000...$head4 (new submodule)\n'> <'\tdiff --git a/sm1/foo1 b/sm1/foo1\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..1715acd\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1/foo1\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo1\n'> <'\tdiff --git a/sm1/foo4 b/sm1/foo4\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..a0016db\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1/foo4\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo4\n'> <'\tdiff --git a/sm1/foo5 b/sm1/foo5\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..d6f2413\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1/foo5\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo5\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (AndOr ops: [Op_DAmp] children: [(C {(rm)} {(-rf)} {(sm1)}) (C {(git)} {(checkout-index)} {(sm1)})] ) (C {(test_expect_success)} {(SQ <'typechanged submodule(submodule->blob)'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head4...0000000 (submodule deleted)\n'> <'\tdiff --git a/sm1 b/sm1\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..9da5fb8\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+sm1\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(rm)} {(-f)} {(sm1)}) (C {(test_create_repo)} {(sm1)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:head6) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(add_file)} {(sm1)} {(foo6)} {(foo7)})]) left_token: <Left_CommandSub '$('> spids: [809 817] ) } spids: [808] ) ] spids: [808] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:fullhead6) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Sentence child: (C {(cd)} {(sm1)}) terminator: <Op_Semi ';'> ) (C {(git)} {(rev-parse)} {(--verify)} {(HEAD)}) ] ) left_token: <Left_CommandSub '$('> spids: [820 833] ) } spids: [819] ) ] spids: [819] ) (C {(test_expect_success)} {(SQ <'nonexistent commit'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head4...$head6 (commits not present)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(commit_file)}) (C {(test_expect_success)} {(SQ <'typechanged submodule(blob->submodule)'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tdiff --git a/sm1 b/sm1\n'> <'\tdeleted file mode 100644\n'> <'\tindex 9da5fb8..0000000\n'> <'\t--- a/sm1\n'> <'\t+++ /dev/null\n'> <'\t@@ -1 +0,0 @@\n'> <'\t-sm1\n'> <'\tSubmodule sm1 0000000...$head6 (new submodule)\n'> <'\tdiff --git a/sm1/foo6 b/sm1/foo6\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..462398b\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1/foo6\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo6\n'> <'\tdiff --git a/sm1/foo7 b/sm1/foo7\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..6e9262c\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1/foo7\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo7\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (AndOr ops: [Op_DAmp] children: [ (C {(commit_file)} {(sm1)}) (C {(test_expect_success)} {(SQ <'submodule is up to date'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) ] ) (C {(test_expect_success)} {(SQ <'submodule contains untracked content'>)} { (SQ <'\n'> <'\techo new > sm1/new-file &&\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains untracked content\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'submodule contains untracked content (untracked ignored)'>)} { (SQ <'\n'> <'\tgit diff-index -p --ignore-submodules=untracked --submodule=diff HEAD >actual &&\n'> <'\t! test -s actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'submodule contains untracked content (dirty ignored)'>)} { (SQ <'\n'> <'\tgit diff-index -p --ignore-submodules=dirty --submodule=diff HEAD >actual &&\n'> <'\t! test -s actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'submodule contains untracked content (all ignored)'>)} { (SQ <'\n'> <'\tgit diff-index -p --ignore-submodules=all --submodule=diff HEAD >actual &&\n'> <'\t! test -s actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'submodule contains untracked and modified content'>)} { (SQ <'\n'> <'\techo new > sm1/foo6 &&\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains untracked content\n'> <'\tSubmodule sm1 contains modified content\n'> <'\tdiff --git a/sm1/foo6 b/sm1/foo6\n'> <'\tindex 462398b..3e75765 100644\n'> <'\t--- a/sm1/foo6\n'> <'\t+++ b/sm1/foo6\n'> <'\t@@ -1 +1 @@\n'> <'\t-foo6\n'> <'\t+new\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'submodule contains untracked and modified content (untracked ignored)'>)} { (SQ <'\n'> <'\techo new > sm1/foo6 &&\n'> <'\tgit diff-index -p --ignore-submodules=untracked --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains modified content\n'> <'\tdiff --git a/sm1/foo6 b/sm1/foo6\n'> <'\tindex 462398b..3e75765 100644\n'> <'\t--- a/sm1/foo6\n'> <'\t+++ b/sm1/foo6\n'> <'\t@@ -1 +1 @@\n'> <'\t-foo6\n'> <'\t+new\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'submodule contains untracked and modified content (dirty ignored)'>)} { (SQ <'\n'> <'\techo new > sm1/foo6 &&\n'> <'\tgit diff-index -p --ignore-submodules=dirty --submodule=diff HEAD >actual &&\n'> <'\t! test -s actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'submodule contains untracked and modified content (all ignored)'>)} { (SQ <'\n'> <'\techo new > sm1/foo6 &&\n'> <'\tgit diff-index -p --ignore-submodules --submodule=diff HEAD >actual &&\n'> <'\t! test -s actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'submodule contains modified content'>)} { (SQ <'\n'> <'\trm -f sm1/new-file &&\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains modified content\n'> <'\tdiff --git a/sm1/foo6 b/sm1/foo6\n'> <'\tindex 462398b..3e75765 100644\n'> <'\t--- a/sm1/foo6\n'> <'\t+++ b/sm1/foo6\n'> <'\t@@ -1 +1 @@\n'> <'\t-foo6\n'> <'\t+new\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (AndOr ops: [Op_DAmp Op_DAmp] children: [ (Subshell child: (CommandList children: [ (Sentence child:(C {(cd)} {(sm1)}) terminator:<Op_Semi ';'>) (SimpleCommand words: [{(git)} {(commit)} {(-mchange)} {(foo6)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [1085] ) ] ) ] ) spids: [1071 1087] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:head8) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Sentence child: (C {(cd)} {(sm1)}) terminator: <Op_Semi ';'> ) (C {(git)} {(rev-parse)} {(--short)} {(--verify)} {(HEAD)}) ] ) left_token: <Left_CommandSub '$('> spids: [1092 1107] ) } spids: [1091] ) ] spids: [1091] ) (C {(test_expect_success)} {(SQ <'submodule is modified'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 17243c9..$head8:\n'> <'\tdiff --git a/sm1/foo6 b/sm1/foo6\n'> <'\tindex 462398b..3e75765 100644\n'> <'\t--- a/sm1/foo6\n'> <'\t+++ b/sm1/foo6\n'> <'\t@@ -1 +1 @@\n'> <'\t-foo6\n'> <'\t+new\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) ] ) (C {(test_expect_success)} {(SQ <'modified submodule contains untracked content'>)} { (SQ <'\n'> <'\techo new > sm1/new-file &&\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains untracked content\n'> <'\tSubmodule sm1 17243c9..$head8:\n'> <'\tdiff --git a/sm1/foo6 b/sm1/foo6\n'> <'\tindex 462398b..3e75765 100644\n'> <'\t--- a/sm1/foo6\n'> <'\t+++ b/sm1/foo6\n'> <'\t@@ -1 +1 @@\n'> <'\t-foo6\n'> <'\t+new\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'modified submodule contains untracked content (untracked ignored)'>)} { (SQ <'\n'> <'\tgit diff-index -p --ignore-submodules=untracked --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 17243c9..$head8:\n'> <'\tdiff --git a/sm1/foo6 b/sm1/foo6\n'> <'\tindex 462398b..3e75765 100644\n'> <'\t--- a/sm1/foo6\n'> <'\t+++ b/sm1/foo6\n'> <'\t@@ -1 +1 @@\n'> <'\t-foo6\n'> <'\t+new\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'modified submodule contains untracked content (dirty ignored)'>)} { (SQ <'\n'> <'\tgit diff-index -p --ignore-submodules=dirty --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 17243c9..cfce562:\n'> <'\tdiff --git a/sm1/foo6 b/sm1/foo6\n'> <'\tindex 462398b..3e75765 100644\n'> <'\t--- a/sm1/foo6\n'> <'\t+++ b/sm1/foo6\n'> <'\t@@ -1 +1 @@\n'> <'\t-foo6\n'> <'\t+new\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'modified submodule contains untracked content (all ignored)'>)} { (SQ <'\n'> <'\tgit diff-index -p --ignore-submodules=all --submodule=diff HEAD >actual &&\n'> <'\t! test -s actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'modified submodule contains untracked and modified content'>)} { (SQ <'\n'> <'\techo modification >> sm1/foo6 &&\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains untracked content\n'> <'\tSubmodule sm1 contains modified content\n'> <'\tSubmodule sm1 17243c9..cfce562:\n'> <'\tdiff --git a/sm1/foo6 b/sm1/foo6\n'> <'\tindex 462398b..dfda541 100644\n'> <'\t--- a/sm1/foo6\n'> <'\t+++ b/sm1/foo6\n'> <'\t@@ -1 +1,2 @@\n'> <'\t-foo6\n'> <'\t+new\n'> <'\t+modification\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'modified submodule contains untracked and modified content (untracked ignored)'>)} { (SQ <'\n'> <'\techo modification >> sm1/foo6 &&\n'> <'\tgit diff-index -p --ignore-submodules=untracked --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains modified content\n'> <'\tSubmodule sm1 17243c9..cfce562:\n'> <'\tdiff --git a/sm1/foo6 b/sm1/foo6\n'> <'\tindex 462398b..e20e2d9 100644\n'> <'\t--- a/sm1/foo6\n'> <'\t+++ b/sm1/foo6\n'> <'\t@@ -1 +1,3 @@\n'> <'\t-foo6\n'> <'\t+new\n'> <'\t+modification\n'> <'\t+modification\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'modified submodule contains untracked and modified content (dirty ignored)'>)} { (SQ <'\n'> <'\techo modification >> sm1/foo6 &&\n'> <'\tgit diff-index -p --ignore-submodules=dirty --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 17243c9..cfce562:\n'> <'\tdiff --git a/sm1/foo6 b/sm1/foo6\n'> <'\tindex 462398b..3e75765 100644\n'> <'\t--- a/sm1/foo6\n'> <'\t+++ b/sm1/foo6\n'> <'\t@@ -1 +1 @@\n'> <'\t-foo6\n'> <'\t+new\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'modified submodule contains untracked and modified content (all ignored)'>)} { (SQ <'\n'> <'\techo modification >> sm1/foo6 &&\n'> <'\tgit diff-index -p --ignore-submodules --submodule=diff HEAD >actual &&\n'> <'\t! test -s actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'modified submodule contains modified content'>)} { (SQ <'\n'> <'\trm -f sm1/new-file &&\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains modified content\n'> <'\tSubmodule sm1 17243c9..cfce562:\n'> <'\tdiff --git a/sm1/foo6 b/sm1/foo6\n'> <'\tindex 462398b..ac466ca 100644\n'> <'\t--- a/sm1/foo6\n'> <'\t+++ b/sm1/foo6\n'> <'\t@@ -1 +1,5 @@\n'> <'\t-foo6\n'> <'\t+new\n'> <'\t+modification\n'> <'\t+modification\n'> <'\t+modification\n'> <'\t+modification\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(rm)} {(-rf)} {(sm1)}) (C {(test_expect_success)} {(SQ <'deleted submodule'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 17243c9...0000000 (submodule deleted)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(test_create_repo)} {(sm2)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:head7) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(add_file)} {(sm2)} {(foo8)} {(foo9)})]) left_token: <Left_CommandSub '$('> spids: [1371 1379] ) } spids: [1370] ) ] spids: [1370] ) (C {(git)} {(add)} {(sm2)}) ] ) (C {(test_expect_success)} {(SQ <'multiple submodules'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=diff HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 17243c9...0000000 (submodule deleted)\n'> <'\tSubmodule sm2 0000000...a5a65c9 (new submodule)\n'> <'\tdiff --git a/sm2/foo8 b/sm2/foo8\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..db9916b\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm2/foo8\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo8\n'> <'\tdiff --git a/sm2/foo9 b/sm2/foo9\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..9c3b4f6\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm2/foo9\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo9\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'path filter'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=diff HEAD sm2 >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm2 0000000...a5a65c9 (new submodule)\n'> <'\tdiff --git a/sm2/foo8 b/sm2/foo8\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..db9916b\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm2/foo8\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo8\n'> <'\tdiff --git a/sm2/foo9 b/sm2/foo9\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..9c3b4f6\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm2/foo9\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo9\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(commit_file)} {(sm2)}) (C {(test_expect_success)} {(SQ <'given commit'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=diff HEAD^ >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 17243c9...0000000 (submodule deleted)\n'> <'\tSubmodule sm2 0000000...a5a65c9 (new submodule)\n'> <'\tdiff --git a/sm2/foo8 b/sm2/foo8\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..db9916b\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm2/foo8\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo8\n'> <'\tdiff --git a/sm2/foo9 b/sm2/foo9\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..9c3b4f6\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm2/foo9\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo9\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'setup .git file for sm2'>)} { (SQ <'\n'> <'\t(cd sm2 &&\n'> <'\t REAL="$(pwd)/../.real" &&\n'> <'\t mv .git "$REAL"\n'> <'\t echo "gitdir: $REAL" >.git)\n'> ) } ) (C {(test_expect_success)} {(SQ <'diff --submodule=diff with .git file'>)} { (SQ <'\n'> <'\tgit diff --submodule=diff HEAD^ >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 17243c9...0000000 (submodule deleted)\n'> <'\tSubmodule sm2 0000000...a5a65c9 (new submodule)\n'> <'\tdiff --git a/sm2/foo8 b/sm2/foo8\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..db9916b\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm2/foo8\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo8\n'> <'\tdiff --git a/sm2/foo9 b/sm2/foo9\n'> <'\tnew file mode 100644\n'> <'\tindex 0000000..9c3b4f6\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm2/foo9\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+foo9\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_done)}) ] )