(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description spids:[12]) op: Equal rhs: {(SQ <'test git rev-parse'>)} spids: [12] ) ] spids: [12] ) (C {(.)} {(./test-lib.sh)}) (command.FuncDef name: test_rev_parse body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:d spids:[33]) op: Equal rhs: (word.EmptyWord) spids: [33] ) ] spids: [33] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:bare spids:[36]) op: Equal rhs: (word.EmptyWord) spids: [36] ) ] spids: [36] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:gitdir spids:[39]) op: Equal rhs: (word.EmptyWord) spids: [39] ) ] spids: [39] ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(Lit_Other ':')})] body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(-C)}] action: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:d spids:[62]) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [62] ) ] spids: [62] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(shift)}) terminator: <Op_Semi ';'> ) (C {(shift)}) ] spids: [59 60 73 16777215] ) (case_arm pat_list: [{(-b)}] action: [ (command.Case to_match: {(DQ ($ VSub_Number '$2'))} arms: [ (case_arm pat_list: [{(Lit_Other '[') (tfu) (Lit_Other ']') (Lit_Other '*')}] action: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:bare spids:[94]) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [94] ) ] spids: [94] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(shift)}) terminator: <Op_Semi ';'> ) (C {(shift)}) ] spids: [88 92 105 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (C {(error)} { (DQ ("test_rev_parse: bogus core.bare value '") ($ VSub_Number '$2') ("'") ) } ) ] spids: [108 109 119 16777215] ) ] spids: [79 85 122] ) ] spids: [76 77 124 16777215] ) (case_arm pat_list: [{(-g)}] action: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:gitdir spids:[130]) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [130] ) ] spids: [130] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(shift)}) terminator: <Op_Semi ';'> ) (C {(shift)}) ] spids: [127 128 141 16777215] ) (case_arm pat_list: [{(-) (Lit_Other '*')}] action: [ (C {(error)} { (DQ ("test_rev_parse: unrecognized option '") ($ VSub_Number '$1') ("'") ) } ) ] spids: [144 146 156 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [(command.ControlFlow token:<ControlFlow_Break break>)] spids: [159 160 164 16777215] ) ] spids: [50 56 167] ) ] spids: [47 170] ) ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:name spids:[174]) op: Equal rhs: {($ VSub_Number '$1')} spids: [174] ) ] spids: [174] ) (C {(shift)}) (command.ForEach iter_name: o iter_words: [ {(--is-bare-repository)} {(--is-inside-git-dir)} {(--is-inside-work-tree)} {(--show-prefix)} {(--git-dir)} ] do_arg_iter: F body: (command.DoGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {($ VSub_Pound '$#')} {(-eq)} {(0)}) (command.ControlFlow token:<ControlFlow_Break break>) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:expect spids:[223]) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [223] ) ] spids: [223] ) (C {(test_expect_success)} {(DQ ($ VSub_Name '$name') (': ') ($ VSub_Name '$o'))} { (SQ <'\n'> <'\t\t\tif test -n "$gitdir"\n'> <'\t\t\tthen\n'> <'\t\t\t\ttest_when_finished "unset GIT_DIR" &&\n'> <'\t\t\t\tGIT_DIR="$gitdir" &&\n'> <'\t\t\t\texport GIT_DIR\n'> <'\t\t\tfi &&\n'> <'\n'> <'\t\t\tcase "$bare" in\n'> <'\t\t\tt*) test_config ${d:+-C} ${d:+"$d"} core.bare true ;;\n'> <'\t\t\tf*) test_config ${d:+-C} ${d:+"$d"} core.bare false ;;\n'> <'\t\t\tu*) test_unconfig ${d:+-C} ${d:+"$d"} core.bare ;;\n'> <'\t\t\tesac &&\n'> <'\n'> <'\t\t\techo "$expect" >expect &&\n'> <'\t\t\tgit ${d:+-C} ${d:+"$d"} rev-parse $o >actual &&\n'> <'\t\t\ttest_cmp expect actual\n'> <'\t\t'> ) } ) (C {(shift)}) ] spids: [207 262] ) spids: [187 16777215] ) ] spids: [30] ) spids: [25 29] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ROOT spids:[267]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(pwd)})]) left_token: <Left_CommandSub '$('> spids: [268 270] ) } spids: [267] ) ] spids: [267] ) (C {(test_expect_success)} {(SQ <setup>)} {(SQ <'\n'> <'\tmkdir -p sub/dir work &&\n'> <'\tcp -R .git repo.git\n'>)} ) (C {(test_rev_parse)} {(toplevel)} {(false)} {(false)} {(true)} {(SQ )} {(.git)}) (C {(test_rev_parse)} {(-C)} {(.git)} {(.git/)} {(false)} {(true)} {(false)} {(SQ )} {(.)}) (C {(test_rev_parse)} {(-C)} {(.git/objects)} {(.git/objects/)} {(false)} {(true)} {(false)} {(SQ )} {(DQ ($ VSub_Name '$ROOT') (/.git))} ) (C {(test_rev_parse)} {(-C)} {(sub/dir)} {(subdirectory)} {(false)} {(false)} {(true)} {(sub/dir/)} {(DQ ($ VSub_Name '$ROOT') (/.git))} ) (C {(test_rev_parse)} {(-b)} {(t)} {(SQ <'core.bare = true'>)} {(true)} {(false)} {(false)}) (C {(test_rev_parse)} {(-b)} {(u)} {(SQ <'core.bare undefined'>)} {(false)} {(false)} {(true)}) (C {(test_rev_parse)} {(-C)} {(work)} {(-g)} {(../.git)} {(-b)} {(f)} {(SQ <'GIT_DIR=../.git, core.bare = false'>)} {(false)} {(false)} {(true)} {(SQ )} ) (C {(test_rev_parse)} {(-C)} {(work)} {(-g)} {(../.git)} {(-b)} {(t)} {(SQ <'GIT_DIR=../.git, core.bare = true'>)} {(true)} {(false)} {(false)} {(SQ )} ) (C {(test_rev_parse)} {(-C)} {(work)} {(-g)} {(../.git)} {(-b)} {(u)} {(SQ <'GIT_DIR=../.git, core.bare undefined'>)} {(false)} {(false)} {(true)} {(SQ )} ) (C {(test_rev_parse)} {(-C)} {(work)} {(-g)} {(../repo.git)} {(-b)} {(f)} {(SQ <'GIT_DIR=../repo.git, core.bare = false'>)} {(false)} {(false)} {(true)} {(SQ )} ) (C {(test_rev_parse)} {(-C)} {(work)} {(-g)} {(../repo.git)} {(-b)} {(t)} {(SQ <'GIT_DIR=../repo.git, core.bare = true'>)} {(true)} {(false)} {(false)} {(SQ )} ) (C {(test_rev_parse)} {(-C)} {(work)} {(-g)} {(../repo.git)} {(-b)} {(u)} {(SQ <'GIT_DIR=../repo.git, core.bare undefined'>)} {(false)} {(false)} {(true)} {(SQ )} ) (C {(test_done)}) ] )