(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"check that certain rev-parse options work outside repo">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ <"set up non-repo directory">)} { (SQ <"\n"> <"\tGIT_CEILING_DIRECTORIES=$(pwd) &&\n"> <"\texport GIT_CEILING_DIRECTORIES &&\n"> <"\tmkdir non-repo &&\n"> <"\tcd non-repo &&\n"> <"\t# confirm that git does not find a repo\n"> <"\ttest_must_fail git rev-parse --git-dir\n"> ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tricky) op: Equal rhs: { (DQ ("really tricky with ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\\">) (" and ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (" and '") ) } spids: [40] ) ] spids: [40] ) (FuncDef name: dump_args body: (BraceGroup children: [ (ForEach iter_name: i iter_words: [{(DQ ($ VSub_At "$@"))}] do_arg_iter: False body: (DoGroup children: [(C {(echo)} {(DQ ("arg: ") ($ VSub_Name "$i"))})] spids: [68 79] ) spids: [62 66] ) ] spids: [54] ) spids: [49 53] ) (C {(test_expect_success)} {(SQ <"rev-parse --sq-quote">)} { (SQ <"\n"> <"\tdump_args \"$tricky\" easy >expect &&\n"> <"\teval \"dump_args $(git rev-parse --sq-quote \"$tricky\" easy)\" >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"rev-parse --local-env-vars">)} { (SQ <"\n"> <"\tgit rev-parse --local-env-vars >actual &&\n"> <"\t# we do not want to depend on the complete list here,\n"> <"\t# so just look for something plausible\n"> <"\tgrep ^GIT_DIR actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"rev-parse --resolve-git-dir">)} { (SQ <"\n"> <"\tgit init --separate-git-dir repo dir &&\n"> <"\ttest_must_fail git rev-parse --resolve-git-dir . &&\n"> <"\techo \"$(pwd)/repo\" >expect &&\n"> <"\tgit rev-parse --resolve-git-dir dir/.git >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (C {(test_done)}) ] )