(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description spids:[12]) op: Equal rhs: {(SQ <'git remote group handling'>)} spids: [12] ) ] spids: [12] ) (C {(.)} {(./test-lib.sh)}) (command.FuncDef name: mark body: (command.BraceGroup children: [ (command.SimpleCommand words: [{(echo)} {(DQ ($ VSub_Number '$1'))}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(mark)})] ) ] spids: [26] ) spids: [22 25] ) (command.FuncDef name: update_repo body: (command.BraceGroup children: [ (command.Subshell child: (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(cd)} {($ VSub_Number '$1')}) (command.SimpleCommand words: [{(echo)} {(content)}] redirects: [(redir.Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(file)})] ) (C {(git)} {(add)} {(file)}) (C {(git)} {(commit)} {(-F)} {(../mark)}) ] ) spids: [48 82] ) ] spids: [45] ) spids: [41 44] ) (command.FuncDef name: update_repos body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(update_repo)} {(one)} {($ VSub_Number '$1')}) (C {(update_repo)} {(two)} {($ VSub_Number '$1')}) ] ) ] spids: [91] ) spids: [87 90] ) (command.FuncDef name: repo_fetched body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(test)} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(log)} {(-1)} {(--pretty) (Lit_Other '=') (format) (Lit_Other ':') (Lit_Other '%') (s) } {($ VSub_Number '$1')} {(--)} ) ] ) left_token: <Left_CommandSub '$('> spids: [124 141] ) ) } {(Lit_Other '=')} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(cat)} {(mark)})]) left_token: <Left_CommandSub '$('> spids: [147 151] ) ) } ) terminator: <Op_Semi ';'> ) ] action: [ (command.SimpleCommand words: [{(echo)} {(DQ ('repo was fetched: ') ($ VSub_Number '$1'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] spids: [16777215 155] ) ] spids: [16777215 174] ) (command.SimpleCommand words: [{(echo)} {(DQ ('repo was not fetched: ') ($ VSub_Number '$1'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [116] ) spids: [112 115] ) (C {(test_expect_success)} {(SQ <setup>)} { (SQ <'\n'> <'\tmkdir one && (cd one && git init) &&\n'> <'\tmkdir two && (cd two && git init) &&\n'> <'\tgit remote add -m master one one &&\n'> <'\tgit remote add -m master two two\n'> ) } ) (C {(test_expect_success)} {(SQ <'no group updates all'>)} { (SQ <'\n'> <'\tmark update-all &&\n'> <'\tupdate_repos &&\n'> <'\tgit remote update &&\n'> <'\trepo_fetched one &&\n'> <'\trepo_fetched two\n'> ) } ) (C {(test_expect_success)} {(SQ <'nonexistent group produces error'>)} { (SQ <'\n'> <'\tmark nonexistent &&\n'> <'\tupdate_repos &&\n'> <'\ttest_must_fail git remote update nonexistent &&\n'> <'\t! repo_fetched one &&\n'> <'\t! repo_fetched two\n'> ) } ) (C {(test_expect_success)} {(SQ <'updating group updates all members (remote update)'>)} { (SQ <'\n'> <'\tmark group-all &&\n'> <'\tupdate_repos &&\n'> <'\tgit config --add remotes.all one &&\n'> <'\tgit config --add remotes.all two &&\n'> <'\tgit remote update all &&\n'> <'\trepo_fetched one &&\n'> <'\trepo_fetched two\n'> ) } ) (C {(test_expect_success)} {(SQ <'updating group updates all members (fetch)'>)} { (SQ <'\n'> <'\tmark fetch-group-all &&\n'> <'\tupdate_repos &&\n'> <'\tgit fetch all &&\n'> <'\trepo_fetched one &&\n'> <'\trepo_fetched two\n'> ) } ) (C {(test_expect_success)} {(SQ <'updating group does not update non-members (remote update)'>)} { (SQ <'\n'> <'\tmark group-some &&\n'> <'\tupdate_repos &&\n'> <'\tgit config --add remotes.some one &&\n'> <'\tgit remote update some &&\n'> <'\trepo_fetched one &&\n'> <'\t! repo_fetched two\n'> ) } ) (C {(test_expect_success)} {(SQ <'updating group does not update non-members (fetch)'>)} { (SQ <'\n'> <'\tmark fetch-group-some &&\n'> <'\tupdate_repos &&\n'> <'\tgit config --add remotes.some one &&\n'> <'\tgit remote update some &&\n'> <'\trepo_fetched one &&\n'> <'\t! repo_fetched two\n'> ) } ) (C {(test_expect_success)} {(SQ <'updating remote name updates that remote'>)} { (SQ <'\n'> <'\tmark remote-name &&\n'> <'\tupdate_repos &&\n'> <'\tgit remote update one &&\n'> <'\trepo_fetched one &&\n'> <'\t! repo_fetched two\n'> ) } ) (C {(test_done)}) ] )