(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <'test git rev-parse'>)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (FuncDef name: test_rev_parse body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:d) op:Equal rhs:{(EmptyPart)} spids:[25])] spids: [25] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:bare) op:Equal rhs:{(EmptyPart)} spids:[28])] spids: [28] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:gitdir) op:Equal rhs:{(EmptyPart)} spids:[31])] spids: [31] ) (While cond: [(C {(Lit_Other ':')})] body: (DoGroup children: [ (Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(-C)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:d) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [54] ) ] spids: [54] ) terminator: <Op_Semi ';'> ) (Sentence child: (C {(shift)}) terminator: <Op_Semi ';'> ) (C {(shift)}) ] spids: [51 52 65 16777215] ) (case_arm pat_list: [{(-b)}] action: [ (Case to_match: {(DQ ($ VSub_Number '$2'))} arms: [ (case_arm pat_list: [{(Lit_Other '[') (tfu) (Lit_Other ']') (Lit_Other '*')}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bare) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [86] ) ] spids: [86] ) terminator: <Op_Semi ';'> ) (Sentence child: (C {(shift)}) terminator: <Op_Semi ';'> ) (C {(shift)}) ] spids: [80 84 97 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (C {(error)} { (DQ ("test_rev_parse: bogus core.bare value '") ($ VSub_Number '$2') ("'") ) } ) ] spids: [100 101 111 16777215] ) ] spids: [71 77 114] ) ] spids: [68 69 116 16777215] ) (case_arm pat_list: [{(-g)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:gitdir) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [122] ) ] spids: [122] ) terminator: <Op_Semi ';'> ) (Sentence child: (C {(shift)}) terminator: <Op_Semi ';'> ) (C {(shift)}) ] spids: [119 120 133 16777215] ) (case_arm pat_list: [{(-) (Lit_Other '*')}] action: [ (C {(error)} { (DQ ("test_rev_parse: unrecognized option '") ($ VSub_Number '$1') ("'") ) } ) ] spids: [136 138 148 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [(ControlFlow token:<ControlFlow_Break break>)] spids: [151 152 156 16777215] ) ] spids: [42 48 159] ) ] spids: [39 162] ) ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: {($ VSub_Number '$1')} spids: [166] ) ] spids: [166] ) (C {(shift)}) (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: (DoGroup children: [ (AndOr ops: [Op_DAmp] children: [ (C {(test)} {($ VSub_Pound '$#')} {(-eq)} {(0)}) (ControlFlow token:<ControlFlow_Break break>) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:expect) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [215] ) ] spids: [215] ) (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: [199 254] ) spids: [179 16777215] ) ] spids: [22] ) spids: [17 21] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ROOT) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(pwd)})]) left_token: <Left_CommandSub '$('> spids: [260 262] ) } spids: [259] ) ] spids: [259] ) (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)}) ] )