(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 <'Test "git submodule foreach"\n'> <'\n'> < 'This test verifies that "git submodule foreach" correctly visits all submodules\n' > <'that are currently checked out.\n'> ) } spids: [13] ) ] redirects: [] ) (C {<.>} {<'./test-lib.sh'>}) (C {<test_expect_success>} {(SQ <'setup a submodule tree'>)} { (SQ <'\n'> <'\techo file > file &&\n'> <'\tgit add file &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m upstream &&\n'> <'\tgit clone . super &&\n'> <'\tgit clone super submodule &&\n'> <'\t(\n'> <'\t\tcd super &&\n'> <'\t\tgit submodule add ../submodule sub1 &&\n'> <'\t\tgit submodule add ../submodule sub2 &&\n'> <'\t\tgit submodule add ../submodule sub3 &&\n'> <'\t\tgit config -f .gitmodules --rename-section \\\n'> <'\t\t\tsubmodule.sub1 submodule.foo1 &&\n'> <'\t\tgit config -f .gitmodules --rename-section \\\n'> <'\t\t\tsubmodule.sub2 submodule.foo2 &&\n'> <'\t\tgit config -f .gitmodules --rename-section \\\n'> <'\t\t\tsubmodule.sub3 submodule.foo3 &&\n'> <'\t\tgit add .gitmodules &&\n'> <'\t\ttest_tick &&\n'> <'\t\tgit commit -m "submodules" &&\n'> <'\t\tgit submodule init sub1 &&\n'> <'\t\tgit submodule init sub2 &&\n'> <'\t\tgit submodule init sub3\n'> <'\t) &&\n'> <'\t(\n'> <'\t\tcd submodule &&\n'> <'\t\techo different > file &&\n'> <'\t\tgit add file &&\n'> <'\t\ttest_tick &&\n'> <'\t\tgit commit -m "different"\n'> <'\t) &&\n'> <'\t(\n'> <'\t\tcd super &&\n'> <'\t\t(\n'> <'\t\t\tcd sub3 &&\n'> <'\t\t\tgit pull\n'> <'\t\t) &&\n'> <'\t\tgit add sub3 &&\n'> <'\t\ttest_tick &&\n'> <'\t\tgit commit -m "update sub3"\n'> <'\t)\n'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sub1sha1='> name:sub1sha1) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.AndOr ops: [Id.Op_DAmp] children: [(C {<cd>} {<'super/sub1'>}) (C {<git>} {<rev-parse>} {<HEAD>})] ) right: <Id.Eof_RParen _> ) } spids: [80] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sub3sha1='> name:sub3sha1) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.AndOr ops: [Id.Op_DAmp] children: [(C {<cd>} {<'super/sub3'>}) (C {<git>} {<rev-parse>} {<HEAD>})] ) right: <Id.Eof_RParen _> ) } spids: [95] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'pwd='> name:pwd) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<pwd>}) right: <Id.Eof_RParen _> ) } spids: [111] ) ] redirects: [] ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 137 stdin_parts: [ <'Entering \'sub1\'\n'> ($ Id.VSub_DollarName pwd) <'/clone-foo1-sub1-'> ($ Id.VSub_DollarName sub1sha1) <'\n'> <'Entering \'sub3\'\n'> ($ Id.VSub_DollarName pwd) <'/clone-foo3-sub3-'> ($ Id.VSub_DollarName sub3sha1) <'\n'> ] ) ) ] more_env: [] do_fork: T ) (C {<test_expect_success>} {(SQ <'test basic "submodule foreach" usage'>)} { (SQ <'\n'> <'\tgit clone super clone &&\n'> <'\t(\n'> <'\t\tcd clone &&\n'> <'\t\tgit submodule update --init -- sub1 sub3 &&\n'> <'\t\tgit submodule foreach "echo \\$toplevel-\\$name-\\$path-\\$sha1" > ../actual &&\n'> <'\t\tgit config foo.bar zar &&\n'> <'\t\tgit submodule foreach "git config --file \\"\\$toplevel/.git/config\\" foo.bar"\n'> <'\t) &&\n'> <'\ttest_i18ncmp expect actual\n'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 178 stdin_parts: [ <'Entering \'../sub1\'\n'> ($ Id.VSub_DollarName pwd) <'/clone-foo1-../sub1-'> ($ Id.VSub_DollarName sub1sha1) <'\n'> <'Entering \'../sub3\'\n'> ($ Id.VSub_DollarName pwd) <'/clone-foo3-../sub3-'> ($ Id.VSub_DollarName sub3sha1) <'\n'> ] ) ) ] more_env: [] do_fork: T ) (C {<test_expect_success>} {(SQ <'test "submodule foreach" from subdirectory'>)} { (SQ <'\n'> <'\tmkdir clone/sub &&\n'> <'\t(\n'> <'\t\tcd clone/sub &&\n'> < '\t\tgit submodule foreach "echo \\$toplevel-\\$name-\\$sm_path-\\$sha1" >../../actual\n' > <'\t) &&\n'> <'\ttest_i18ncmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'setup nested submodules'>)} { (SQ <'\n'> <'\tgit clone submodule nested1 &&\n'> <'\tgit clone submodule nested2 &&\n'> <'\tgit clone submodule nested3 &&\n'> <'\t(\n'> <'\t\tcd nested3 &&\n'> <'\t\tgit submodule add ../submodule submodule &&\n'> <'\t\ttest_tick &&\n'> <'\t\tgit commit -m "submodule" &&\n'> <'\t\tgit submodule init submodule\n'> <'\t) &&\n'> <'\t(\n'> <'\t\tcd nested2 &&\n'> <'\t\tgit submodule add ../nested3 nested3 &&\n'> <'\t\ttest_tick &&\n'> <'\t\tgit commit -m "nested3" &&\n'> <'\t\tgit submodule init nested3\n'> <'\t) &&\n'> <'\t(\n'> <'\t\tcd nested1 &&\n'> <'\t\tgit submodule add ../nested2 nested2 &&\n'> <'\t\ttest_tick &&\n'> <'\t\tgit commit -m "nested2" &&\n'> <'\t\tgit submodule init nested2\n'> <'\t) &&\n'> <'\t(\n'> <'\t\tcd super &&\n'> <'\t\tgit submodule add ../nested1 nested1 &&\n'> <'\t\ttest_tick &&\n'> <'\t\tgit commit -m "nested1" &&\n'> <'\t\tgit submodule init nested1\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'use "submodule foreach" to checkout 2nd level submodule'>)} { (SQ <'\n'> <'\tgit clone super clone2 &&\n'> <'\t(\n'> <'\t\tcd clone2 &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir sub1/.git &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir sub2/.git &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir sub3/.git &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir nested1/.git &&\n'> <'\t\tgit submodule update --init &&\n'> <'\t\tgit rev-parse --resolve-git-dir sub1/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir sub2/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir sub3/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/.git &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir nested1/nested2/.git &&\n'> <'\t\tgit submodule foreach "git submodule update --init" &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/nested2/.git &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir nested1/nested2/nested3/.git\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'use "foreach --recursive" to checkout all submodules'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd clone2 &&\n'> <'\t\tgit submodule foreach --recursive "git submodule update --init" &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/nested2/nested3/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/nested2/nested3/submodule/.git\n'> <'\t)\n'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 301 stdin_parts: [ <'Entering \'nested1\'\n'> <'Entering \'nested1/nested2\'\n'> <'Entering \'nested1/nested2/nested3\'\n'> <'Entering \'nested1/nested2/nested3/submodule\'\n'> <'Entering \'sub1\'\n'> <'Entering \'sub2\'\n'> <'Entering \'sub3\'\n'> ] ) ) ] more_env: [] do_fork: T ) (C {<test_expect_success>} {(SQ <'test messages from "foreach --recursive"'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd clone2 &&\n'> <'\t\tgit submodule foreach --recursive "true" > ../actual\n'> <'\t) &&\n'> <'\ttest_i18ncmp expect actual\n'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 336 stdin_parts: [ <'Entering \'../nested1\'\n'> <'Entering \'../nested1/nested2\'\n'> <'Entering \'../nested1/nested2/nested3\'\n'> <'Entering \'../nested1/nested2/nested3/submodule\'\n'> <'Entering \'../sub1\'\n'> <'Entering \'../sub2\'\n'> <'Entering \'../sub3\'\n'> ] ) ) ] more_env: [] do_fork: T ) (C {<test_expect_success>} {(SQ <'test messages from "foreach --recursive" from subdirectory'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd clone2 &&\n'> <'\t\tmkdir untracked &&\n'> <'\t\tcd untracked &&\n'> <'\t\tgit submodule foreach --recursive >../../actual\n'> <'\t) &&\n'> <'\ttest_i18ncmp expect actual\n'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 373 stdin_parts: [ <'nested1-nested1\n'> <'nested2-nested2\n'> <'nested3-nested3\n'> <'submodule-submodule\n'> <'foo1-sub1\n'> <'foo2-sub2\n'> <'foo3-sub3\n'> ] ) ) ] more_env: [] do_fork: T ) (C {<test_expect_success>} {(SQ <'test "foreach --quiet --recursive"'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd clone2 &&\n'> <'\t\tgit submodule foreach -q --recursive "echo \\$name-\\$path" > ../actual\n'> <'\t) &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'use "update --recursive" to checkout all submodules'>)} { (SQ <'\n'> <'\tgit clone super clone3 &&\n'> <'\t(\n'> <'\t\tcd clone3 &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir sub1/.git &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir sub2/.git &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir sub3/.git &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir nested1/.git &&\n'> <'\t\tgit submodule update --init --recursive &&\n'> <'\t\tgit rev-parse --resolve-git-dir sub1/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir sub2/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir sub3/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/nested2/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/nested2/nested3/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/nested2/nested3/submodule/.git\n'> <'\t)\n'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'nested1sha1='> name:nested1sha1) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.AndOr ops: [Id.Op_DAmp] children: [(C {<cd>} {<'clone3/nested1'>}) (C {<git>} {<rev-parse>} {<HEAD>})] ) right: <Id.Eof_RParen _> ) } spids: [418] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'nested2sha1='> name:nested2sha1) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<cd>} {<'clone3/nested1/nested2'>}) (C {<git>} {<rev-parse>} {<HEAD>}) ] ) right: <Id.Eof_RParen _> ) } spids: [433] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'nested3sha1='> name:nested3sha1) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<cd>} {<'clone3/nested1/nested2/nested3'>}) (C {<git>} {<rev-parse>} {<HEAD>}) ] ) right: <Id.Eof_RParen _> ) } spids: [448] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'submodulesha1='> name:submodulesha1) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<cd>} {<'clone3/nested1/nested2/nested3/submodule'>}) (C {<git>} {<rev-parse>} {<HEAD>}) ] ) right: <Id.Eof_RParen _> ) } spids: [463] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sub1sha1='> name:sub1sha1) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.AndOr ops: [Id.Op_DAmp] children: [(C {<cd>} {<'clone3/sub1'>}) (C {<git>} {<rev-parse>} {<HEAD>})] ) right: <Id.Eof_RParen _> ) } spids: [478] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sub2sha1='> name:sub2sha1) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.AndOr ops: [Id.Op_DAmp] children: [(C {<cd>} {<'clone3/sub2'>}) (C {<git>} {<rev-parse>} {<HEAD>})] ) right: <Id.Eof_RParen _> ) } spids: [493] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sub3sha1='> name:sub3sha1) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.AndOr ops: [Id.Op_DAmp] children: [(C {<cd>} {<'clone3/sub3'>}) (C {<git>} {<rev-parse>} {<HEAD>})] ) right: <Id.Eof_RParen _> ) } spids: [508] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sub1sha1_short='> name:sub1sha1_short) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<cd>} {<'clone3/sub1'>}) (C {<git>} {<rev-parse>} {<--short>} {<HEAD>}) ] ) right: <Id.Eof_RParen _> ) } spids: [523] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sub2sha1_short='> name:sub2sha1_short) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<cd>} {<'clone3/sub2'>}) (C {<git>} {<rev-parse>} {<--short>} {<HEAD>}) ] ) right: <Id.Eof_RParen _> ) } spids: [540] ) ] redirects: [] ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 593 stdin_parts: [ <' '> ($ Id.VSub_DollarName nested1sha1) <' nested1 (heads/master)\n'> <' '> ($ Id.VSub_DollarName nested2sha1) <' nested1/nested2 (heads/master)\n'> <' '> ($ Id.VSub_DollarName nested3sha1) <' nested1/nested2/nested3 (heads/master)\n'> <' '> ($ Id.VSub_DollarName submodulesha1) <' nested1/nested2/nested3/submodule (heads/master)\n'> <' '> ($ Id.VSub_DollarName sub1sha1) <' sub1 ('> ($ Id.VSub_DollarName sub1sha1_short) <')\n'> <' '> ($ Id.VSub_DollarName sub2sha1) <' sub2 ('> ($ Id.VSub_DollarName sub2sha1_short) <')\n'> <' '> ($ Id.VSub_DollarName sub3sha1) <' sub3 (heads/master)\n'> ] ) ) ] more_env: [] do_fork: T ) (C {<test_expect_success>} {(SQ <'test "status --recursive"'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd clone3 &&\n'> <'\t\tgit submodule status --recursive > ../actual\n'> <'\t) &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 633 stdin_parts: [ <' '> ($ Id.VSub_DollarName nested1sha1) <' nested1 (heads/master)\n'> <'+'> ($ Id.VSub_DollarName nested2sha1) <' nested1/nested2 (file2~1)\n'> <' '> ($ Id.VSub_DollarName nested3sha1) <' nested1/nested2/nested3 (heads/master)\n'> <' '> ($ Id.VSub_DollarName submodulesha1) <' nested1/nested2/nested3/submodule (heads/master)\n'> ] ) ) ] more_env: [] do_fork: T ) (C {<test_expect_success>} {(SQ <'ensure "status --cached --recursive" preserves the --cached flag'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd clone3 &&\n'> <'\t\t(\n'> <'\t\t\tcd nested1/nested2 &&\n'> <'\t\t\ttest_commit file2\n'> <'\t\t) &&\n'> <'\t\tgit submodule status --cached --recursive -- nested1 > ../actual\n'> <'\t) &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'nested2sha1='> name:nested2sha1) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<-C>} {<'clone3/nested1/nested2'>} {<rev-parse>} {<HEAD>}) right: <Id.Eof_RParen _> ) } spids: [655] ) ] redirects: [] ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 704 stdin_parts: [ <' '> ($ Id.VSub_DollarName nested1sha1) <' ../nested1 (heads/master)\n'> <'+'> ($ Id.VSub_DollarName nested2sha1) <' ../nested1/nested2 (file2)\n'> <' '> ($ Id.VSub_DollarName nested3sha1) <' ../nested1/nested2/nested3 (heads/master)\n'> <' '> ($ Id.VSub_DollarName submodulesha1) <' ../nested1/nested2/nested3/submodule (heads/master)\n'> <' '> ($ Id.VSub_DollarName sub1sha1) <' ../sub1 ('> ($ Id.VSub_DollarName sub1sha1_short) <')\n'> <' '> ($ Id.VSub_DollarName sub2sha1) <' ../sub2 ('> ($ Id.VSub_DollarName sub2sha1_short) <')\n'> <' '> ($ Id.VSub_DollarName sub3sha1) <' ../sub3 (heads/master)\n'> ] ) ) ] more_env: [] do_fork: T ) (C {<test_expect_success>} {(SQ <'test "status --recursive" from sub directory'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd clone3 &&\n'> <'\t\tmkdir tmp && cd tmp &&\n'> <'\t\tgit submodule status --recursive > ../../actual\n'> <'\t) &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'use "git clone --recursive" to checkout all submodules'>)} { (SQ <'\n'> <'\tgit clone --recursive super clone4 &&\n'> <'\t(\n'> <'\t\tcd clone4 &&\n'> <'\t\tgit rev-parse --resolve-git-dir .git &&\n'> <'\t\tgit rev-parse --resolve-git-dir sub1/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir sub2/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir sub3/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/nested2/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/nested2/nested3/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/nested2/nested3/submodule/.git\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'test "update --recursive" with a flag with spaces'>)} { (SQ <'\n'> <'\tgit clone super "common objects" &&\n'> <'\tgit clone super clone5 &&\n'> <'\t(\n'> <'\t\tcd clone5 &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir d nested1/.git &&\n'> < '\t\tgit submodule update --init --recursive --reference="$(dirname "$PWD")/common objects" &&\n' > <'\t\tgit rev-parse --resolve-git-dir nested1/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/nested2/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/nested2/nested3/.git &&\n'> <'\t\ttest -f .git/modules/nested1/objects/info/alternates &&\n'> <'\t\ttest -f .git/modules/nested1/modules/nested2/objects/info/alternates &&\n'> < '\t\ttest -f .git/modules/nested1/modules/nested2/modules/nested3/objects/info/alternates\n' > <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'use "update --recursive nested1" to checkout all submodules rooted in nested1'>)} { (SQ <'\n'> <'\tgit clone super clone6 &&\n'> <'\t(\n'> <'\t\tcd clone6 &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir sub1/.git &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir sub2/.git &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir sub3/.git &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir nested1/.git &&\n'> <'\t\tgit submodule update --init --recursive -- nested1 &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir sub1/.git &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir sub2/.git &&\n'> <'\t\ttest_must_fail git rev-parse --resolve-git-dir sub3/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/nested2/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/nested2/nested3/.git &&\n'> <'\t\tgit rev-parse --resolve-git-dir nested1/nested2/nested3/submodule/.git\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'command passed to foreach retains notion of stdin'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd super &&\n'> <'\t\tgit submodule foreach echo success >../expected &&\n'> <'\t\tyes | git submodule foreach "read y && test \\"x\\$y\\" = xy && echo success" >../actual\n'> <'\t) &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'command passed to foreach --recursive retains notion of stdin'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd clone2 &&\n'> <'\t\tgit submodule foreach --recursive echo success >../expected &&\n'> < '\t\tyes | git submodule foreach --recursive "read y && test \\"x\\$y\\" = xy && echo success" >../actual\n' > <'\t) &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'multi-argument command passed to foreach is not shell-evaluated twice'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd super &&\n'> <'\t\tgit submodule foreach "echo \\\\\\"quoted\\\\\\"" > ../expected &&\n'> <'\t\tgit submodule foreach echo \\"quoted\\" > ../actual\n'> <'\t) &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_done>}) ] )