(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description) op: assign_op.Equal rhs: { (SQ <'Support for verbose submodule differences in git diff\n'> <'\n'> <'This test tries to verify the sanity of the --submodule option of git diff.\n'> ) } spids: [16] ) ] redirects: [] ) (C {<.>} {<'./test-lib.sh'>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_encoding='> name:test_encoding) op: assign_op.Equal rhs: {(DQ <ISO8859-1>)} spids: [32] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'added='> name:added) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<printf>} { (DQ <hinzugef> <Id.Lit_BadBackslash '\\'> <303> <Id.Lit_BadBackslash '\\'> <274gt>) } ) right: <Id.Eof_RParen _> ) } spids: [44] ) ] redirects: [] ) (command.ShFunction name: add_file body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Subshell child: (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (C {<cd>} {(DQ ($ Id.VSub_Number 1))}) (C {<shift>}) (command.ForEach iter_names: [name] iterable: (for_iter.Args) body: (command.DoGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (command.Simple words: [{<echo>} {(DQ ($ Id.VSub_DollarName name))}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {(DQ ($ Id.VSub_DollarName name))} ) ] more_env: [] do_fork: T ) (C {<git>} {<add>} {(DQ ($ Id.VSub_DollarName name))}) (C {<test_tick>}) (command.Pipeline children: [ (C {<echo>} { (DQ <'Add '> ($ Id.VSub_DollarName name) <' ('> ($ Id.VSub_DollarName added) <' '> ($ Id.VSub_DollarName name) <')'> ) } ) (C {<iconv>} {<-f>} {<utf-8>} {<-t>} {($ Id.VSub_DollarName test_encoding)} ) (C {<git>} {<-c>} { (DQ <'i18n.commitEncoding='> ($ Id.VSub_DollarName test_encoding) ) } {<commit>} {<-F>} {<->} ) ] negated: F stderr_indices: [] ) ] ) ] ) redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] ) (C {<git>} {<rev-parse>} {<--short>} {<--verify>} {<HEAD>}) ] ) redirects: [] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name: commit_file body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<test_tick>}) (command.Simple words: [ {<git>} {<commit>} {(DQ ($ Id.VSub_At '@'))} {<-m>} {(DQ <'Commit '> ($ Id.VSub_Star '*'))} ] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] more_env: [] do_fork: T ) ] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<test_create_repo>} {<sm1>}) (command.Simple words: [{<add_file>} {<.>} {<foo>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'/dev/null'>})] more_env: [] do_fork: T ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'head1='> name:head1) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<add_file>} {<sm1>} {<foo1>} {<foo2>}) right: <Id.Eof_RParen _> ) } spids: [244] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'fullhead1='> name:fullhead1) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.CommandList children: [ (command.Sentence child: (C {<cd>} {<sm1>}) terminator: <Id.Op_Semi _> ) (C {<git>} {<rev-parse>} {<--verify>} {<HEAD>}) ] ) right: <Id.Eof_RParen _> ) } spids: [255] ) ] redirects: [] ) (C {<test_expect_success>} {(SQ <'added submodule'>)} { (SQ <'\n'> <'\tgit add sm1 &&\n'> <'\tgit diff-index -p --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 0000000...$head1 (new submodule)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'added submodule, set diff.submodule'>)} { (SQ <'\n'> <'\tgit config diff.submodule log &&\n'> <'\tgit add sm1 &&\n'> <'\tgit diff --cached >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 0000000...$head1 (new submodule)\n'> <'\tEOF\n'> <'\tgit config --unset diff.submodule &&\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'> ) } ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<commit_file>} {<sm1>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'head2='> name:head2) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<add_file>} {<sm1>} {<foo3>}) right: <Id.Eof_RParen _> ) } spids: [361] ) ] redirects: [] ) ] ) (C {<test_expect_success>} {(SQ <'modified submodule(forward)'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head1..$head2:\n'> <'\t > Add foo3 ($added foo3)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'modified submodule(forward)'>)} { (SQ <'\n'> <'\tgit diff --submodule=log >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head1..$head2:\n'> <'\t > Add foo3 ($added 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'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'fullhead2='> name:fullhead2) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.CommandList children: [ (command.Sentence child: (C {<cd>} {<sm1>}) terminator: <Id.Op_Semi _> ) (C {<git>} {<rev-parse>} {<--verify>} {<HEAD>}) ] ) right: <Id.Eof_RParen _> ) } spids: [422] ) ] redirects: [] ) (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'> ) } ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<commit_file>} {<sm1>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'head3='> name:head3) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (C {<cd>} {<sm1>}) (command.Simple words: [{<git>} {<reset>} {<--hard>} {<HEAD> <Id.Lit_TildeLike '~2'>}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] more_env: [] do_fork: T ) (C {<git>} {<rev-parse>} {<--short>} {<--verify>} {<HEAD>}) ] ) right: <Id.Eof_RParen _> ) } spids: [466] ) ] redirects: [] ) ] ) (C {<test_expect_success>} {(SQ <'modified submodule(backward)'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head2..$head3 (rewind):\n'> <'\t < Add foo3 ($added foo3)\n'> <'\t < Add foo2 ($added foo2)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'head4='> name:head4) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<add_file>} {<sm1>} {<foo4>} {<foo5>}) right: <Id.Eof_RParen _> ) } spids: [523] ) ] redirects: [] ) (C {<test_expect_success>} {(SQ <'modified submodule(backward and forward)'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head2...$head4:\n'> <'\t > Add foo5 ($added foo5)\n'> <'\t > Add foo4 ($added foo4)\n'> <'\t < Add foo3 ($added foo3)\n'> <'\t < Add foo2 ($added foo2)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (C {<commit_file>} {<sm1>}) (C {<mv>} {<sm1>} {<sm1-bak>}) (command.Simple words: [{<echo>} {<sm1>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<sm1>})] more_env: [] do_fork: T ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'head5='> name:head5) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [(C {<git>} {<hash-object>} {<sm1>}) (C {<cut>} {<-c1-7>})] negated: F stderr_indices: [] ) right: <Id.Eof_RParen _> ) } spids: [577] ) ] redirects: [] ) (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=log --cached >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..$head5\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=log >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tdiff --git a/sm1 b/sm1\n'> <'\tdeleted file mode 100644\n'> <'\tindex $head5..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'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (command.AndOr ops: [Id.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=log 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..$head5\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm1\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+sm1\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (C {<rm>} {<-f>} {<sm1>}) (C {<test_create_repo>} {<sm1>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'head6='> name:head6) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<add_file>} {<sm1>} {<foo6>} {<foo7>}) right: <Id.Eof_RParen _> ) } spids: [714] ) ] redirects: [] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'fullhead6='> name:fullhead6) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.CommandList children: [ (command.Sentence child: (C {<cd>} {<sm1>}) terminator: <Id.Op_Semi _> ) (C {<git>} {<rev-parse>} {<--verify>} {<HEAD>}) ] ) right: <Id.Eof_RParen _> ) } spids: [725] ) ] redirects: [] ) (C {<test_expect_success>} {(SQ <'nonexistent commit'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=log 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=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tdiff --git a/sm1 b/sm1\n'> <'\tdeleted file mode 100644\n'> <'\tindex $head5..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'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<commit_file>} {<sm1>}) (C {<test_expect_success>} {(SQ <'submodule is up to date'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=log 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=log 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=log 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=log 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=log HEAD >actual &&\n'> <'\t! test -s actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'submodule contains untracked and modifed content'>)} { (SQ <'\n'> <'\techo new > sm1/foo6 &&\n'> <'\tgit diff-index -p --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains untracked content\n'> <'\tSubmodule sm1 contains modified content\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'submodule contains untracked and modifed content (untracked ignored)'>)} { (SQ <'\n'> <'\techo new > sm1/foo6 &&\n'> <'\tgit diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains modified content\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'submodule contains untracked and modifed content (dirty ignored)'>)} { (SQ <'\n'> <'\techo new > sm1/foo6 &&\n'> <'\tgit diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&\n'> <'\t! test -s actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'submodule contains untracked and modifed content (all ignored)'>)} { (SQ <'\n'> <'\techo new > sm1/foo6 &&\n'> <'\tgit diff-index -p --ignore-submodules --submodule=log HEAD >actual &&\n'> <'\t! test -s actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'submodule contains modifed content'>)} { (SQ <'\n'> <'\trm -f sm1/new-file &&\n'> <'\tgit diff-index -p --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains modified content\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (command.Subshell child: (command.CommandList children: [ (command.Sentence child:(C {<cd>} {<sm1>}) terminator:<Id.Op_Semi _>) (command.Simple words: [{<git>} {<commit>} {<-mchange>} {<foo6>}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] more_env: [] do_fork: T ) ] ) redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'head8='> name:head8) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.CommandList children: [ (command.Sentence child: (C {<cd>} {<sm1>}) terminator: <Id.Op_Semi _> ) (C {<git>} {<rev-parse>} {<--short>} {<--verify>} {<HEAD>}) ] ) right: <Id.Eof_RParen _> ) } spids: [959] ) ] redirects: [] ) (C {<test_expect_success>} {(SQ <'submodule is modified'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head6..$head8:\n'> <'\t > change\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=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains untracked content\n'> <'\tSubmodule sm1 $head6..$head8:\n'> <'\t > change\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=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head6..$head8:\n'> <'\t > change\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=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head6..$head8:\n'> <'\t > change\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=log HEAD >actual &&\n'> <'\t! test -s actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'modified submodule contains untracked and modifed content'>)} { (SQ <'\n'> <'\techo modification >> sm1/foo6 &&\n'> <'\tgit diff-index -p --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains untracked content\n'> <'\tSubmodule sm1 contains modified content\n'> <'\tSubmodule sm1 $head6..$head8:\n'> <'\t > change\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'modified submodule contains untracked and modifed content (untracked ignored)'>)} { (SQ <'\n'> <'\techo modification >> sm1/foo6 &&\n'> <'\tgit diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains modified content\n'> <'\tSubmodule sm1 $head6..$head8:\n'> <'\t > change\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'modified submodule contains untracked and modifed content (dirty ignored)'>)} { (SQ <'\n'> <'\techo modification >> sm1/foo6 &&\n'> <'\tgit diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head6..$head8:\n'> <'\t > change\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'modified submodule contains untracked and modifed content (all ignored)'>)} { (SQ <'\n'> <'\techo modification >> sm1/foo6 &&\n'> <'\tgit diff-index -p --ignore-submodules --submodule=log HEAD >actual &&\n'> <'\t! test -s actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'modified submodule contains modifed content'>)} { (SQ <'\n'> <'\trm -f sm1/new-file &&\n'> <'\tgit diff-index -p --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 contains modified content\n'> <'\tSubmodule sm1 $head6..$head8:\n'> <'\t > change\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=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head6...0000000 (submodule deleted)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (C {<test_create_repo>} {<sm2>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'head7='> name:head7) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<add_file>} {<sm2>} {<foo8>} {<foo9>}) right: <Id.Eof_RParen _> ) } spids: [1180] ) ] redirects: [] ) (C {<git>} {<add>} {<sm2>}) ] ) (C {<test_expect_success>} {(SQ <'multiple submodules'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=log HEAD >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head6...0000000 (submodule deleted)\n'> <'\tSubmodule sm2 0000000...$head7 (new submodule)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'path filter'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=log HEAD sm2 >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm2 0000000...$head7 (new submodule)\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=log HEAD^ >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head6...0000000 (submodule deleted)\n'> <'\tSubmodule sm2 0000000...$head7 (new submodule)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'given commit --submodule'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule HEAD^ >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head6...0000000 (submodule deleted)\n'> <'\tSubmodule sm2 0000000...$head7 (new submodule)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'fullhead7='> name:fullhead7) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.CommandList children: [ (command.Sentence child: (C {<cd>} {<sm2>}) terminator: <Id.Op_Semi _> ) (C {<git>} {<rev-parse>} {<--verify>} {<HEAD>}) ] ) right: <Id.Eof_RParen _> ) } spids: [1271] ) ] redirects: [] ) (C {<test_expect_success>} {(SQ <'given commit --submodule=short'>)} { (SQ <'\n'> <'\tgit diff-index -p --submodule=short HEAD^ >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tdiff --git a/sm1 b/sm1\n'> <'\tdeleted file mode 160000\n'> <'\tindex $head6..0000000\n'> <'\t--- a/sm1\n'> <'\t+++ /dev/null\n'> <'\t@@ -1 +0,0 @@\n'> <'\t-Subproject commit $fullhead6\n'> <'\tdiff --git a/sm2 b/sm2\n'> <'\tnew file mode 160000\n'> <'\tindex 0000000..$head7\n'> <'\t--- /dev/null\n'> <'\t+++ b/sm2\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+Subproject commit $fullhead7\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 with .git file'>)} { (SQ <'\n'> <'\tgit diff --submodule HEAD^ >actual &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tSubmodule sm1 $head6...0000000 (submodule deleted)\n'> <'\tSubmodule sm2 0000000...$head7 (new submodule)\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'diff --submodule with objects referenced by alternates'>)} { (SQ <'\n'> <'\tmkdir sub_alt &&\n'> <'\t(cd sub_alt &&\n'> <'\t\tgit init &&\n'> <'\t\techo a >a &&\n'> <'\t\tgit add a &&\n'> <'\t\tgit commit -m a\n'> <'\t) &&\n'> <'\tmkdir super &&\n'> <'\t(cd super &&\n'> <'\t\tgit clone -s ../sub_alt sub &&\n'> <'\t\tgit init &&\n'> <'\t\tgit add sub &&\n'> <'\t\tgit commit -m "sub a"\n'> <'\t) &&\n'> <'\t(cd sub_alt &&\n'> <'\t\tsha1_before=$(git rev-parse --short HEAD)\n'> <'\t\techo b >b &&\n'> <'\t\tgit add b &&\n'> <'\t\tgit commit -m b &&\n'> <'\t\tsha1_after=$(git rev-parse --short HEAD) &&\n'> <'\t\t{\n'> <'\t\t\techo "Submodule sub $sha1_before..$sha1_after:" &&\n'> <'\t\t\techo " > b"\n'> <'\t\t} >../expected\n'> <'\t) &&\n'> <'\t(cd super &&\n'> <'\t\t(cd sub &&\n'> <'\t\t\tgit fetch &&\n'> <'\t\t\tgit checkout origin/master\n'> <'\t\t) &&\n'> <'\t\tgit diff --submodule > ../actual\n'> <'\t) &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_done>}) ] )