(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: { (DQ ('Tests of cwd/prefix/worktree/gitdir setup in all cases\n') ('\n') ('A few rules for repo setup:\n') ('\n') ("1. GIT_DIR is relative to user's cwd. --git-dir is equivalent to\n") (' GIT_DIR.\n') ('\n') ('2. .git file is relative to parent directory. .git file is basically\n') (' symlink in disguise. The directory where .git file points to will\n') (' become new git_dir.\n') ('\n') ('3. core.worktree is relative to git_dir.\n') ('\n') ("4. GIT_WORK_TREE is relative to user's cwd. --work-tree is\n") (' equivalent to GIT_WORK_TREE.\n') ('\n') ('5. GIT_WORK_TREE/core.worktree was originally meant to work only if\n') (" GIT_DIR is set, but earlier git didn't enforce it, and some scripts\n") (' depend on the implementation that happened to first discover .git by\n') (' going up from the users ') ($ Id.VSub_DollarName '$cwd') (' and then using the specified working tree\n') (' that may or may not have any relation to where .git was found in. This\n') (' historical behaviour must be kept.\n') ('\n') ('6. Effective GIT_WORK_TREE overrides core.worktree and core.bare\n') ('\n') ('7. Effective core.worktree conflicts with core.bare\n') ('\n') ('8. If GIT_DIR is set but neither worktree nor bare setting is given,\n') (' original cwd becomes worktree.\n') ('\n') ('9. If .git discovery is done inside a repo, the repo becomes a bare\n') (' repo. .git discovery is performed if GIT_DIR is not set.\n') ('\n') ('10. If no worktree is available, cwd remains unchanged, prefix is\n') (' NULL.\n') ('\n') ("11. When user's cwd is outside worktree, cwd remains unchanged,\n") (' prefix is NULL.\n') ) } spids: [4] ) ] ) (C {(.)} {(./test-lib.sh)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:here) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:54) command_list: (command.CommandList children:[(C {(pwd)})]) ) } spids: [53] ) ] ) (command.ShFunction name: test_repo body: (command.BraceGroup children: [ (command.Subshell command_list: (command.CommandList children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (C {(cd)} {(DQ ($ Id.VSub_Number '$1'))}) (command.If arms: [ (if_arm cond: [(C {(test)} {(-n)} {(DQ ($ Id.VSub_Number '$2'))})] action: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:GIT_DIR) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$2'))} spids: [93] ) ] ) (C {(export)} {(GIT_DIR)}) ] ) ] spids: [79 90] ) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(-n)} {(DQ ($ Id.VSub_Number '$3'))})] action: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:GIT_WORK_TREE) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$3'))} spids: [125] ) ] ) (C {(export)} {(GIT_WORK_TREE)}) ] ) ] spids: [111 122] ) ] ) (C {(rm)} {(-f)} {(trace)}) (command.Simple words: [{(git)} {(symbolic-ref)} {(HEAD)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:166) fd: -1 arg_word: {(/dev/null)} ) ] more_env: [ (env_pair name: GIT_TRACE_SETUP val: { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:154) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/trace) ) } spids: [152] ) ] ) (command.Simple words: [ {(grep)} {(SQ (Token id:Id.Lit_Chars val:'^setup: ' span_id:175))} {(trace)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:180) fd: -1 arg_word: {(result)} ) ] ) (C {(test_cmp)} {(expected)} {(result)}) ] ) ] ) ) ] ) ) (command.ShFunction name: maybe_config body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:file) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [206] ) (assign_pair lhs: (sh_lhs_expr.Name name:var) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [209] ) (assign_pair lhs: (sh_lhs_expr.Name name:value) op: assign_op.Equal rhs: {($ Id.VSub_Number '$3')} spids: [212] ) ] ) (command.If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ Id.VSub_DollarName '$value'))} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(unset)} ) ] action: [ (C {(git)} {(config)} {(--file) (Id.Lit_Equals '=') (DQ ($ Id.VSub_DollarName '$file'))} {(DQ ($ Id.VSub_DollarName '$var'))} {(DQ ($ Id.VSub_DollarName '$value'))} ) ] spids: [218 232] ) ] ) ] ) ] ) ) (command.ShFunction name: setup_repo body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [267] ) (assign_pair lhs: (sh_lhs_expr.Name name:worktreecfg) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [270] ) (assign_pair lhs: (sh_lhs_expr.Name name:gitfile) op: assign_op.Equal rhs: {($ Id.VSub_Number '$3')} spids: [273] ) (assign_pair lhs: (sh_lhs_expr.Name name:barecfg) op: assign_op.Equal rhs: {($ Id.VSub_Number '$4')} spids: [276] ) ] ) (C {(sane_unset)} {(GIT_DIR)} {(GIT_WORK_TREE)}) (C {(git)} {(init)} {(DQ ($ Id.VSub_DollarName '$name'))}) (C {(maybe_config)} {(DQ ($ Id.VSub_DollarName '$name') (/.git/config))} {(core.worktree)} {(DQ ($ Id.VSub_DollarName '$worktreecfg'))} ) (C {(maybe_config)} {(DQ ($ Id.VSub_DollarName '$name') (/.git/config))} {(core.bare)} {(DQ ($ Id.VSub_DollarName '$barecfg'))} ) (C {(mkdir)} {(-p)} {(DQ ($ Id.VSub_DollarName '$name') (/sub/sub))}) (command.If arms: [ (if_arm cond: [ (C {(test)} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:gitfile span_id:354) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonPlus arg_word:{(set)}) ) ) } ) ] action: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(mv)} {(DQ ($ Id.VSub_DollarName '$name') (/.git))} {(DQ ($ Id.VSub_DollarName '$name') (.git))} ) (command.Simple words: [ {(echo)} {(DQ ('gitdir: ../') ($ Id.VSub_DollarName '$name') (.git))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:387) fd: -1 arg_word: {(DQ ($ Id.VSub_DollarName '$name') (/.git))} ) ] ) ] ) ] spids: [348 361] ) ] ) ] ) ] ) ) (command.ShFunction name: maybe_set body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:var) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [407] ) (assign_pair lhs: (sh_lhs_expr.Name name:value) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [410] ) ] ) (command.If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ Id.VSub_DollarName '$value'))} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(unset)} ) ] action: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(eval)} { (DQ ($ Id.VSub_DollarName '$var') ('=') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:438) ) (value) ) } ) (C {(export)} {($ Id.VSub_DollarName '$var')}) ] ) ] spids: [416 430] ) ] ) ] ) ] ) ) (command.ShFunction name: setup_env body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:worktreenv) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [463] ) (assign_pair lhs: (sh_lhs_expr.Name name:gitdirenv) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [466] ) ] ) (C {(sane_unset)} {(GIT_DIR)} {(GIT_WORK_TREE)}) (C {(maybe_set)} {(GIT_DIR)} {(DQ ($ Id.VSub_DollarName '$gitdirenv'))}) (C {(maybe_set)} {(GIT_WORK_TREE)} {(DQ ($ Id.VSub_DollarName '$worktreeenv'))}) ] ) ] ) ) (command.ShFunction name: expect body: (command.BraceGroup children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:513) fd: -1 arg_word: {(DQ ($ Id.VSub_Number '$1') (/expected))} ) (redir.HereDoc op: (Token id:Id.Redir_DLessDash val:'<<-' span_id:519) fd: -1 here_begin: {(EOF)} here_end_span_id: 538 stdin_parts: [ ('setup: git_dir: ') ($ Id.VSub_Number '$2') ('\n') ('setup: git_common_dir: ') ($ Id.VSub_Number '$2') ('\n') ('setup: worktree: ') ($ Id.VSub_Number '$3') ('\n') ('setup: cwd: ') ($ Id.VSub_Number '$4') ('\n') ('setup: prefix: ') ($ Id.VSub_Number '$5') ('\n') ] ) ] ) ] ) ) (command.ShFunction name: try_case body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [550] ) (assign_pair lhs: (sh_lhs_expr.Name name:worktreeenv) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [553] ) (assign_pair lhs: (sh_lhs_expr.Name name:gitdirenv) op: assign_op.Equal rhs: {($ Id.VSub_Number '$3')} spids: [556] ) ] ) (C {(setup_env)} {(DQ ($ Id.VSub_DollarName '$worktreeenv'))} {(DQ ($ Id.VSub_DollarName '$gitdirenv'))} ) (C {(expect)} {(DQ ($ Id.VSub_DollarName '$name'))} {(DQ ($ Id.VSub_Number '$4'))} {(DQ ($ Id.VSub_Number '$5'))} {(DQ ($ Id.VSub_Number '$6'))} {(DQ ($ Id.VSub_Number '$7'))} ) (C {(test_repo)} {(DQ ($ Id.VSub_DollarName '$name'))}) ] ) ] ) ) (command.ShFunction name: run_wt_tests body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:N) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [617] ) (assign_pair lhs: (sh_lhs_expr.Name name:gitfile) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [620] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:absgit) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$here') (/) ($ Id.VSub_DollarName '$N') (/.git))} spids: [625] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:dotgit) op: assign_op.Equal rhs: {(.git)} spids: [634] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:dotdotgit) op: assign_op.Equal rhs: {(../../.git)} spids: [638] ) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ Id.VSub_DollarName '$gitfile'))})] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:absgit) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$here') (/) ($ Id.VSub_DollarName '$N') (.git)) } spids: [655] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:dotgit) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$absgit')} spids: [664] ) (assign_pair lhs: (sh_lhs_expr.Name name:dotdotgit) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$absgit')} spids: [667] ) ] ) ] spids: [643 652] ) ] ) (C {(test_expect_success)} { (DQ ('#') ($ Id.VSub_DollarName '$N') (': explicit GIT_WORK_TREE and GIT_DIR at toplevel') ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:684) (Token id: Id.Lit_Chars val: '\t\ttry_case $N "$here/$N" .git \\\n' span_id: 685 ) (Token id:Id.Lit_Chars val:'\t\t\t"$dotgit" "$here/$N" "$here/$N" "(null)" &&\n' span_id:686) (Token id: Id.Lit_Chars val: '\t\ttry_case $N . .git \\\n' span_id: 687 ) (Token id:Id.Lit_Chars val:'\t\t\t"$dotgit" "$here/$N" "$here/$N" "(null)" &&\n' span_id:688) (Token id: Id.Lit_Chars val: '\t\ttry_case $N "$here/$N" "$here/$N/.git" \\\n' span_id: 689 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here/$N" "$here/$N" "(null)" &&\n' span_id:690) (Token id: Id.Lit_Chars val: '\t\ttry_case $N . "$here/$N/.git" \\\n' span_id: 691 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here/$N" "$here/$N" "(null)"\n' span_id:692) (Token id:Id.Lit_Chars val:'\t' span_id:693) ) } ) (C {(test_expect_success)} { (DQ ('#') ($ Id.VSub_DollarName '$N') (': explicit GIT_WORK_TREE and GIT_DIR in subdir') ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:707) (Token id: Id.Lit_Chars val: '\t\ttry_case $N/sub/sub "$here/$N" ../../.git \\\n' span_id: 708 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here/$N" "$here/$N" sub/sub/ &&\n' span_id:709) (Token id: Id.Lit_Chars val: '\t\ttry_case $N/sub/sub ../.. ../../.git \\\n' span_id: 710 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here/$N" "$here/$N" sub/sub/ &&\n' span_id:711) (Token id: Id.Lit_Chars val: '\t\ttry_case $N/sub/sub "$here/$N" "$here/$N/.git" \\\n' span_id: 712 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here/$N" "$here/$N" sub/sub/ &&\n' span_id:713) (Token id: Id.Lit_Chars val: '\t\ttry_case $N/sub/sub ../.. "$here/$N/.git" \\\n' span_id: 714 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here/$N" "$here/$N" sub/sub/\n' span_id:715) (Token id:Id.Lit_Chars val:'\t' span_id:716) ) } ) (C {(test_expect_success)} { (DQ ('#') ($ Id.VSub_DollarName '$N') (': explicit GIT_WORK_TREE from parent of worktree') ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:730) (Token id: Id.Lit_Chars val: '\t\ttry_case $N "$here/$N/wt" .git \\\n' span_id: 731 ) (Token id:Id.Lit_Chars val:'\t\t\t"$dotgit" "$here/$N/wt" "$here/$N" "(null)" &&\n' span_id:732) (Token id: Id.Lit_Chars val: '\t\ttry_case $N wt .git \\\n' span_id: 733 ) (Token id:Id.Lit_Chars val:'\t\t\t"$dotgit" "$here/$N/wt" "$here/$N" "(null)" &&\n' span_id:734) (Token id: Id.Lit_Chars val: '\t\ttry_case $N wt "$here/$N/.git" \\\n' span_id: 735 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here/$N/wt" "$here/$N" "(null)" &&\n' span_id:736) (Token id: Id.Lit_Chars val: '\t\ttry_case $N "$here/$N/wt" "$here/$N/.git" \\\n' span_id: 737 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here/$N/wt" "$here/$N" "(null)"\n' span_id:738) (Token id:Id.Lit_Chars val:'\t' span_id:739) ) } ) (C {(test_expect_success)} { (DQ ('#') ($ Id.VSub_DollarName '$N') (': explicit GIT_WORK_TREE from nephew of worktree') ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:753) (Token id: Id.Lit_Chars val: '\t\ttry_case $N/sub/sub "$here/$N/wt" ../../.git \\\n' span_id: 754 ) (Token id: Id.Lit_Chars val: '\t\t\t"$dotdotgit" "$here/$N/wt" "$here/$N/sub/sub" "(null)" &&\n' span_id: 755 ) (Token id:Id.Lit_Chars val:'\t\ttry_case $N/sub/sub ../../wt ../../.git \\\n' span_id:756) (Token id: Id.Lit_Chars val: '\t\t\t"$dotdotgit" "$here/$N/wt" "$here/$N/sub/sub" "(null)" &&\n' span_id: 757 ) (Token id:Id.Lit_Chars val:'\t\ttry_case $N/sub/sub ../../wt "$here/$N/.git" \\\n' span_id:758) (Token id: Id.Lit_Chars val: '\t\t\t"$absgit" "$here/$N/wt" "$here/$N/sub/sub" "(null)" &&\n' span_id: 759 ) (Token id:Id.Lit_Chars val:'\t\ttry_case $N/sub/sub "$here/$N/wt" "$here/$N/.git" \\\n' span_id:760) (Token id: Id.Lit_Chars val: '\t\t\t"$absgit" "$here/$N/wt" "$here/$N/sub/sub" "(null)"\n' span_id: 761 ) (Token id:Id.Lit_Chars val:'\t' span_id:762) ) } ) (C {(test_expect_success)} { (DQ ('#') ($ Id.VSub_DollarName '$N') (': chdir_to_toplevel uses worktree, not git dir') ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:776) (Token id: Id.Lit_Chars val: '\t\ttry_case $N "$here" .git \\\n' span_id: 777 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here" "$here" $N/ &&\n' span_id:778) (Token id: Id.Lit_Chars val: '\t\ttry_case $N .. .git \\\n' span_id: 779 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here" "$here" $N/ &&\n' span_id:780) (Token id: Id.Lit_Chars val: '\t\ttry_case $N .. "$here/$N/.git" \\\n' span_id: 781 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here" "$here" $N/ &&\n' span_id:782) (Token id: Id.Lit_Chars val: '\t\ttry_case $N "$here" "$here/$N/.git" \\\n' span_id: 783 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here" "$here" $N/\n' span_id:784) (Token id:Id.Lit_Chars val:'\t' span_id:785) ) } ) (C {(test_expect_success)} { (DQ ('#') ($ Id.VSub_DollarName '$N') (': chdir_to_toplevel uses worktree (from subdir)') ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:799) (Token id: Id.Lit_Chars val: '\t\ttry_case $N/sub/sub "$here" ../../.git \\\n' span_id: 800 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here" "$here" $N/sub/sub/ &&\n' span_id:801) (Token id: Id.Lit_Chars val: '\t\ttry_case $N/sub/sub ../../.. ../../.git \\\n' span_id: 802 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here" "$here" $N/sub/sub/ &&\n' span_id:803) (Token id: Id.Lit_Chars val: '\t\ttry_case $N/sub/sub ../../../ "$here/$N/.git" \\\n' span_id: 804 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here" "$here" $N/sub/sub/ &&\n' span_id:805) (Token id: Id.Lit_Chars val: '\t\ttry_case $N/sub/sub "$here" "$here/$N/.git" \\\n' span_id: 806 ) (Token id:Id.Lit_Chars val:'\t\t\t"$absgit" "$here" "$here" $N/sub/sub/\n' span_id:807) (Token id:Id.Lit_Chars val:'\t' span_id:808) ) } ) ] ) ) (command.ShFunction name: try_repo body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [831] ) (assign_pair lhs: (sh_lhs_expr.Name name:worktreeenv) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [834] ) (assign_pair lhs: (sh_lhs_expr.Name name:gitdirenv) op: assign_op.Equal rhs: {($ Id.VSub_Number '$3')} spids: [837] ) ] ) (C {(setup_repo)} {(DQ ($ Id.VSub_DollarName '$name'))} {(DQ ($ Id.VSub_Number '$4'))} {(DQ ($ Id.VSub_Number '$5'))} {(DQ ($ Id.VSub_Number '$6'))} ) (C {(shift)} {(6)}) (C {(try_case)} {(DQ ($ Id.VSub_DollarName '$name'))} {(DQ ($ Id.VSub_DollarName '$worktreeenv'))} {(DQ ($ Id.VSub_DollarName '$gitdirenv'))} {(DQ ($ Id.VSub_Number '$1'))} {(DQ ($ Id.VSub_Number '$2'))} {(DQ ($ Id.VSub_Number '$3'))} {(DQ ($ Id.VSub_Number '$4'))} ) (C {(shift)} {(4)}) (command.Case to_match: {(DQ ($ Id.VSub_DollarName '$gitdirenv'))} arms: [ (case_arm pat_list: [ {(/) (Id.Lit_Star '*')} {(Id.Lit_QMark '?') (Id.Lit_Other ':') (/) (Id.Lit_Star '*')} {(unset)} ] spids: [922 935 937 -1] ) (case_arm pat_list: [{(Id.Lit_Star '*')}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:gitdirenv) op: assign_op.Equal rhs: {(../) ($ Id.VSub_DollarName '$gitdirenv')} spids: [944] ) ] ) ] spids: [940 941 948 -1] ) ] ) (C {(try_case)} {(DQ ($ Id.VSub_DollarName '$name') (/sub))} {(DQ ($ Id.VSub_DollarName '$worktreeenv'))} {(DQ ($ Id.VSub_DollarName '$gitdirenv'))} {(DQ ($ Id.VSub_Number '$1'))} {(DQ ($ Id.VSub_Number '$2'))} {(DQ ($ Id.VSub_Number '$3'))} {(DQ ($ Id.VSub_Number '$4'))} ) ] ) ] ) ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#0: nonbare repo, no explicit configuration' span_id:1014))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1018) (Token id: Id.Lit_Chars val: '\ttry_repo 0 unset unset unset "" unset \\\n' span_id: 1019 ) (Token id:Id.Lit_Chars val:'\t\t.git "$here/0" "$here/0" "(null)" \\\n' span_id:1020) (Token id: Id.Lit_Chars val: '\t\t.git "$here/0" "$here/0" sub/ 2>message &&\n' span_id: 1021 ) (Token id:Id.Lit_Chars val:'\t! test -s message\n' span_id:1022) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#1: GIT_WORK_TREE without explicit GIT_DIR is accepted' span_id: 1029 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1033) (Token id:Id.Lit_Chars val:'\tmkdir -p wt &&\n' span_id:1034) (Token id:Id.Lit_Chars val:'\ttry_repo 1 "$here" unset unset "" unset \\\n' span_id:1035) (Token id: Id.Lit_Chars val: '\t\t"$here/1/.git" "$here" "$here" 1/ \\\n' span_id: 1036 ) (Token id:Id.Lit_Chars val:'\t\t"$here/1/.git" "$here" "$here" 1/sub/ 2>message &&\n' span_id:1037) (Token id:Id.Lit_Chars val:'\t! test -s message\n' span_id:1038) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#2: worktree defaults to cwd with explicit GIT_DIR' span_id: 1045 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1049) (Token id: Id.Lit_Chars val: '\ttry_repo 2 unset "$here/2/.git" unset "" unset \\\n' span_id: 1050 ) (Token id:Id.Lit_Chars val:'\t\t"$here/2/.git" "$here/2" "$here/2" "(null)" \\\n' span_id:1051) (Token id: Id.Lit_Chars val: '\t\t"$here/2/.git" "$here/2/sub" "$here/2/sub" "(null)"\n' span_id: 1052 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#2b: relative GIT_DIR' span_id:1059))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1063) (Token id: Id.Lit_Chars val: '\ttry_repo 2b unset ".git" unset "" unset \\\n' span_id: 1064 ) (Token id:Id.Lit_Chars val:'\t\t".git" "$here/2b" "$here/2b" "(null)" \\\n' span_id:1065) (Token id: Id.Lit_Chars val: '\t\t"../.git" "$here/2b/sub" "$here/2b/sub" "(null)"\n' span_id: 1066 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#3: setup' span_id:1073))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1077) (Token id:Id.Lit_Chars val:'\tsetup_repo 3 unset "" unset &&\n' span_id:1078) (Token id:Id.Lit_Chars val:'\tmkdir -p 3/sub/sub 3/wt/sub\n' span_id:1079) ) } ) (C {(run_wt_tests)} {(3)}) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#4: core.worktree without GIT_DIR set is accepted' span_id: 1090 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1094) (Token id:Id.Lit_Chars val:'\tsetup_repo 4 ../sub "" unset &&\n' span_id:1095) (Token id:Id.Lit_Chars val:'\tmkdir -p 4/sub sub &&\n' span_id:1096) (Token id:Id.Lit_Chars val:'\ttry_case 4 unset unset \\\n' span_id:1097) (Token id:Id.Lit_Chars val:'\t\t.git "$here/4/sub" "$here/4" "(null)" \\\n' span_id:1098) (Token id: Id.Lit_Chars val: '\t\t"$here/4/.git" "$here/4/sub" "$here/4/sub" "(null)" 2>message &&\n' span_id: 1099 ) (Token id:Id.Lit_Chars val:'\t! test -s message\n' span_id:1100) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#5: core.worktree + GIT_WORK_TREE is accepted' span_id:1107))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1111) (Token id: Id.Lit_Chars val: '\t# or: you cannot intimidate away the lack of GIT_DIR setting\n' span_id: 1112 ) (Token id:Id.Lit_Chars val:'\ttry_repo 5 "$here" unset "$here/5" "" unset \\\n' span_id:1113) (Token id: Id.Lit_Chars val: '\t\t"$here/5/.git" "$here" "$here" 5/ \\\n' span_id: 1114 ) (Token id:Id.Lit_Chars val:'\t\t"$here/5/.git" "$here" "$here" 5/sub/ 2>message &&\n' span_id:1115) (Token id: Id.Lit_Chars val: '\ttry_repo 5a .. unset "$here/5a" "" unset \\\n' span_id: 1116 ) (Token id:Id.Lit_Chars val:'\t\t"$here/5a/.git" "$here" "$here" 5a/ \\\n' span_id:1117) (Token id: Id.Lit_Chars val: '\t\t"$here/5a/.git" "$here/5a" "$here/5a" sub/ &&\n' span_id: 1118 ) (Token id:Id.Lit_Chars val:'\t! test -s message\n' span_id:1119) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#6: setting GIT_DIR brings core.worktree to life' span_id: 1126 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1130) (Token id:Id.Lit_Chars val:'\tsetup_repo 6 "$here/6" "" unset &&\n' span_id:1131) (Token id:Id.Lit_Chars val:'\ttry_case 6 unset .git \\\n' span_id:1132) (Token id: Id.Lit_Chars val: '\t\t.git "$here/6" "$here/6" "(null)" &&\n' span_id: 1133 ) (Token id:Id.Lit_Chars val:'\ttry_case 6 unset "$here/6/.git" \\\n' span_id:1134) (Token id: Id.Lit_Chars val: '\t\t"$here/6/.git" "$here/6" "$here/6" "(null)" &&\n' span_id: 1135 ) (Token id:Id.Lit_Chars val:'\ttry_case 6/sub/sub unset ../../.git \\\n' span_id:1136) (Token id: Id.Lit_Chars val: '\t\t"$here/6/.git" "$here/6" "$here/6" sub/sub/ &&\n' span_id: 1137 ) (Token id:Id.Lit_Chars val:'\ttry_case 6/sub/sub unset "$here/6/.git" \\\n' span_id:1138) (Token id: Id.Lit_Chars val: '\t\t"$here/6/.git" "$here/6" "$here/6" sub/sub/\n' span_id: 1139 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#6b: GIT_DIR set, core.worktree relative' span_id:1146))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1150) (Token id:Id.Lit_Chars val:'\tsetup_repo 6b .. "" unset &&\n' span_id:1151) (Token id:Id.Lit_Chars val:'\ttry_case 6b unset .git \\\n' span_id:1152) (Token id: Id.Lit_Chars val: '\t\t.git "$here/6b" "$here/6b" "(null)" &&\n' span_id: 1153 ) (Token id:Id.Lit_Chars val:'\ttry_case 6b unset "$here/6b/.git" \\\n' span_id:1154) (Token id: Id.Lit_Chars val: '\t\t"$here/6b/.git" "$here/6b" "$here/6b" "(null)" &&\n' span_id: 1155 ) (Token id:Id.Lit_Chars val:'\ttry_case 6b/sub/sub unset ../../.git \\\n' span_id:1156) (Token id: Id.Lit_Chars val: '\t\t"$here/6b/.git" "$here/6b" "$here/6b" sub/sub/ &&\n' span_id: 1157 ) (Token id:Id.Lit_Chars val:'\ttry_case 6b/sub/sub unset "$here/6b/.git" \\\n' span_id:1158) (Token id: Id.Lit_Chars val: '\t\t"$here/6b/.git" "$here/6b" "$here/6b" sub/sub/\n' span_id: 1159 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#6c: GIT_DIR set, core.worktree=../wt (absolute)' span_id: 1166 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1170) (Token id: Id.Lit_Chars val: '\tsetup_repo 6c "$here/6c/wt" "" unset &&\n' span_id: 1171 ) (Token id:Id.Lit_Chars val:'\tmkdir -p 6c/wt/sub &&\n' span_id:1172) (Token id:Id.Lit_Chars val:'\n' span_id:1173) (Token id:Id.Lit_Chars val:'\ttry_case 6c unset .git \\\n' span_id:1174) (Token id: Id.Lit_Chars val: '\t\t.git "$here/6c/wt" "$here/6c" "(null)" &&\n' span_id: 1175 ) (Token id:Id.Lit_Chars val:'\ttry_case 6c unset "$here/6c/.git" \\\n' span_id:1176) (Token id: Id.Lit_Chars val: '\t\t"$here/6c/.git" "$here/6c/wt" "$here/6c" "(null)" &&\n' span_id: 1177 ) (Token id:Id.Lit_Chars val:'\ttry_case 6c/sub/sub unset ../../.git \\\n' span_id:1178) (Token id: Id.Lit_Chars val: '\t\t../../.git "$here/6c/wt" "$here/6c/sub/sub" "(null)" &&\n' span_id: 1179 ) (Token id:Id.Lit_Chars val:'\ttry_case 6c/sub/sub unset "$here/6c/.git" \\\n' span_id:1180) (Token id: Id.Lit_Chars val: '\t\t"$here/6c/.git" "$here/6c/wt" "$here/6c/sub/sub" "(null)"\n' span_id: 1181 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#6d: GIT_DIR set, core.worktree=../wt (relative)' span_id: 1188 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1192) (Token id: Id.Lit_Chars val: '\tsetup_repo 6d "$here/6d/wt" "" unset &&\n' span_id: 1193 ) (Token id:Id.Lit_Chars val:'\tmkdir -p 6d/wt/sub &&\n' span_id:1194) (Token id:Id.Lit_Chars val:'\n' span_id:1195) (Token id:Id.Lit_Chars val:'\ttry_case 6d unset .git \\\n' span_id:1196) (Token id: Id.Lit_Chars val: '\t\t.git "$here/6d/wt" "$here/6d" "(null)" &&\n' span_id: 1197 ) (Token id:Id.Lit_Chars val:'\ttry_case 6d unset "$here/6d/.git" \\\n' span_id:1198) (Token id: Id.Lit_Chars val: '\t\t"$here/6d/.git" "$here/6d/wt" "$here/6d" "(null)" &&\n' span_id: 1199 ) (Token id:Id.Lit_Chars val:'\ttry_case 6d/sub/sub unset ../../.git \\\n' span_id:1200) (Token id: Id.Lit_Chars val: '\t\t../../.git "$here/6d/wt" "$here/6d/sub/sub" "(null)" &&\n' span_id: 1201 ) (Token id:Id.Lit_Chars val:'\ttry_case 6d/sub/sub unset "$here/6d/.git" \\\n' span_id:1202) (Token id: Id.Lit_Chars val: '\t\t"$here/6d/.git" "$here/6d/wt" "$here/6d/sub/sub" "(null)"\n' span_id: 1203 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#6e: GIT_DIR set, core.worktree=../.. (absolute)' span_id: 1210 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1214) (Token id:Id.Lit_Chars val:'\tsetup_repo 6e "$here" "" unset &&\n' span_id:1215) (Token id:Id.Lit_Chars val:'\ttry_case 6e unset .git \\\n' span_id:1216) (Token id: Id.Lit_Chars val: '\t\t"$here/6e/.git" "$here" "$here" 6e/ &&\n' span_id: 1217 ) (Token id:Id.Lit_Chars val:'\ttry_case 6e unset "$here/6e/.git" \\\n' span_id:1218) (Token id: Id.Lit_Chars val: '\t\t"$here/6e/.git" "$here" "$here" 6e/ &&\n' span_id: 1219 ) (Token id:Id.Lit_Chars val:'\ttry_case 6e/sub/sub unset ../../.git \\\n' span_id:1220) (Token id: Id.Lit_Chars val: '\t\t"$here/6e/.git" "$here" "$here" 6e/sub/sub/ &&\n' span_id: 1221 ) (Token id:Id.Lit_Chars val:'\ttry_case 6e/sub/sub unset "$here/6e/.git" \\\n' span_id:1222) (Token id: Id.Lit_Chars val: '\t\t"$here/6e/.git" "$here" "$here" 6e/sub/sub/\n' span_id: 1223 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#6f: GIT_DIR set, core.worktree=../.. (relative)' span_id: 1230 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1234) (Token id:Id.Lit_Chars val:'\tsetup_repo 6f ../../ "" unset &&\n' span_id:1235) (Token id:Id.Lit_Chars val:'\ttry_case 6f unset .git \\\n' span_id:1236) (Token id: Id.Lit_Chars val: '\t\t"$here/6f/.git" "$here" "$here" 6f/ &&\n' span_id: 1237 ) (Token id:Id.Lit_Chars val:'\ttry_case 6f unset "$here/6f/.git" \\\n' span_id:1238) (Token id: Id.Lit_Chars val: '\t\t"$here/6f/.git" "$here" "$here" 6f/ &&\n' span_id: 1239 ) (Token id:Id.Lit_Chars val:'\ttry_case 6f/sub/sub unset ../../.git \\\n' span_id:1240) (Token id: Id.Lit_Chars val: '\t\t"$here/6f/.git" "$here" "$here" 6f/sub/sub/ &&\n' span_id: 1241 ) (Token id:Id.Lit_Chars val:'\ttry_case 6f/sub/sub unset "$here/6f/.git" \\\n' span_id:1242) (Token id: Id.Lit_Chars val: '\t\t"$here/6f/.git" "$here" "$here" 6f/sub/sub/\n' span_id: 1243 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#7: setup' span_id:1253))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1257) (Token id: Id.Lit_Chars val: '\tsetup_repo 7 non-existent "" unset &&\n' span_id: 1258 ) (Token id:Id.Lit_Chars val:'\tmkdir -p 7/sub/sub 7/wt/sub\n' span_id:1259) ) } ) (C {(run_wt_tests)} {(7)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#8: gitfile, easy case' span_id:1270))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1274) (Token id: Id.Lit_Chars val: '\ttry_repo 8 unset unset unset gitfile unset \\\n' span_id: 1275 ) (Token id:Id.Lit_Chars val:'\t\t"$here/8.git" "$here/8" "$here/8" "(null)" \\\n' span_id:1276) (Token id: Id.Lit_Chars val: '\t\t"$here/8.git" "$here/8" "$here/8" sub/\n' span_id: 1277 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#9: GIT_WORK_TREE accepted with gitfile' span_id:1284))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1288) (Token id:Id.Lit_Chars val:'\tmkdir -p 9/wt &&\n' span_id:1289) (Token id:Id.Lit_Chars val:'\ttry_repo 9 wt unset unset gitfile unset \\\n' span_id:1290) (Token id: Id.Lit_Chars val: '\t\t"$here/9.git" "$here/9/wt" "$here/9" "(null)" \\\n' span_id: 1291 ) (Token id: Id.Lit_Chars val: '\t\t"$here/9.git" "$here/9/sub/wt" "$here/9/sub" "(null)" 2>message &&\n' span_id: 1292 ) (Token id:Id.Lit_Chars val:'\t! test -s message\n' span_id:1293) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#10: GIT_DIR can point to gitfile' span_id:1300))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1304) (Token id: Id.Lit_Chars val: '\ttry_repo 10 unset "$here/10/.git" unset gitfile unset \\\n' span_id: 1305 ) (Token id:Id.Lit_Chars val:'\t\t"$here/10.git" "$here/10" "$here/10" "(null)" \\\n' span_id:1306) (Token id: Id.Lit_Chars val: '\t\t"$here/10.git" "$here/10/sub" "$here/10/sub" "(null)"\n' span_id: 1307 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#10b: relative GIT_DIR can point to gitfile' span_id:1314))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1318) (Token id: Id.Lit_Chars val: '\ttry_repo 10b unset .git unset gitfile unset \\\n' span_id: 1319 ) (Token id:Id.Lit_Chars val:'\t\t"$here/10b.git" "$here/10b" "$here/10b" "(null)" \\\n' span_id:1320) (Token id: Id.Lit_Chars val: '\t\t"$here/10b.git" "$here/10b/sub" "$here/10b/sub" "(null)"\n' span_id: 1321 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#11: setup' span_id:1331))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1335) (Token id: Id.Lit_Chars val: '\tsetup_repo 11 unset gitfile unset &&\n' span_id: 1336 ) (Token id:Id.Lit_Chars val:'\tmkdir -p 11/sub/sub 11/wt/sub\n' span_id:1337) ) } ) (C {(run_wt_tests)} {(11)} {(gitfile)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#12: core.worktree with gitfile is accepted' span_id:1350))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1354) (Token id: Id.Lit_Chars val: '\ttry_repo 12 unset unset "$here/12" gitfile unset \\\n' span_id: 1355 ) (Token id:Id.Lit_Chars val:'\t\t"$here/12.git" "$here/12" "$here/12" "(null)" \\\n' span_id:1356) (Token id: Id.Lit_Chars val: '\t\t"$here/12.git" "$here/12" "$here/12" sub/ 2>message &&\n' span_id: 1357 ) (Token id:Id.Lit_Chars val:'\t! test -s message\n' span_id:1358) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#13: core.worktree+GIT_WORK_TREE accepted (with gitfile)' span_id: 1365 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1369) (Token id: Id.Lit_Chars val: '\t# or: you cannot intimidate away the lack of GIT_DIR setting\n' span_id: 1370 ) (Token id: Id.Lit_Chars val: '\ttry_repo 13 non-existent-too unset non-existent gitfile unset \\\n' span_id: 1371 ) (Token id: Id.Lit_Chars val: '\t\t"$here/13.git" "$here/13/non-existent-too" "$here/13" "(null)" \\\n' span_id: 1372 ) (Token id: Id.Lit_Chars val: '\t\t"$here/13.git" "$here/13/sub/non-existent-too" "$here/13/sub" "(null)" 2>message &&\n' span_id: 1373 ) (Token id:Id.Lit_Chars val:'\t! test -s message\n' span_id:1374) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#14: core.worktree with GIT_DIR pointing to gitfile' span_id: 1388 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1392) (Token id: Id.Lit_Chars val: '\tsetup_repo 14 "$here/14" gitfile unset &&\n' span_id: 1393 ) (Token id:Id.Lit_Chars val:'\ttry_case 14 unset .git \\\n' span_id:1394) (Token id: Id.Lit_Chars val: '\t\t"$here/14.git" "$here/14" "$here/14" "(null)" &&\n' span_id: 1395 ) (Token id:Id.Lit_Chars val:'\ttry_case 14 unset "$here/14/.git" \\\n' span_id:1396) (Token id: Id.Lit_Chars val: '\t\t"$here/14.git" "$here/14" "$here/14" "(null)" &&\n' span_id: 1397 ) (Token id:Id.Lit_Chars val:'\ttry_case 14/sub/sub unset ../../.git \\\n' span_id:1398) (Token id: Id.Lit_Chars val: '\t\t"$here/14.git" "$here/14" "$here/14" sub/sub/ &&\n' span_id: 1399 ) (Token id:Id.Lit_Chars val:'\ttry_case 14/sub/sub unset "$here/14/.git" \\\n' span_id:1400) (Token id: Id.Lit_Chars val: '\t\t"$here/14.git" "$here/14" "$here/14" sub/sub/ &&\n' span_id: 1401 ) (Token id:Id.Lit_Chars val:'\n' span_id:1402) (Token id: Id.Lit_Chars val: '\tsetup_repo 14c "$here/14c/wt" gitfile unset &&\n' span_id: 1403 ) (Token id:Id.Lit_Chars val:'\tmkdir -p 14c/wt/sub &&\n' span_id:1404) (Token id:Id.Lit_Chars val:'\n' span_id:1405) (Token id:Id.Lit_Chars val:'\ttry_case 14c unset .git \\\n' span_id:1406) (Token id: Id.Lit_Chars val: '\t\t"$here/14c.git" "$here/14c/wt" "$here/14c" "(null)" &&\n' span_id: 1407 ) (Token id:Id.Lit_Chars val:'\ttry_case 14c unset "$here/14c/.git" \\\n' span_id:1408) (Token id: Id.Lit_Chars val: '\t\t"$here/14c.git" "$here/14c/wt" "$here/14c" "(null)" &&\n' span_id: 1409 ) (Token id:Id.Lit_Chars val:'\ttry_case 14c/sub/sub unset ../../.git \\\n' span_id:1410) (Token id: Id.Lit_Chars val: '\t\t"$here/14c.git" "$here/14c/wt" "$here/14c/sub/sub" "(null)" &&\n' span_id: 1411 ) (Token id:Id.Lit_Chars val:'\ttry_case 14c/sub/sub unset "$here/14c/.git" \\\n' span_id:1412) (Token id: Id.Lit_Chars val: '\t\t"$here/14c.git" "$here/14c/wt" "$here/14c/sub/sub" "(null)" &&\n' span_id: 1413 ) (Token id:Id.Lit_Chars val:'\n' span_id:1414) (Token id: Id.Lit_Chars val: '\tsetup_repo 14d "$here/14d/wt" gitfile unset &&\n' span_id: 1415 ) (Token id:Id.Lit_Chars val:'\tmkdir -p 14d/wt/sub &&\n' span_id:1416) (Token id:Id.Lit_Chars val:'\n' span_id:1417) (Token id:Id.Lit_Chars val:'\ttry_case 14d unset .git \\\n' span_id:1418) (Token id: Id.Lit_Chars val: '\t\t"$here/14d.git" "$here/14d/wt" "$here/14d" "(null)" &&\n' span_id: 1419 ) (Token id:Id.Lit_Chars val:'\ttry_case 14d unset "$here/14d/.git" \\\n' span_id:1420) (Token id: Id.Lit_Chars val: '\t\t"$here/14d.git" "$here/14d/wt" "$here/14d" "(null)" &&\n' span_id: 1421 ) (Token id:Id.Lit_Chars val:'\ttry_case 14d/sub/sub unset ../../.git \\\n' span_id:1422) (Token id: Id.Lit_Chars val: '\t\t"$here/14d.git" "$here/14d/wt" "$here/14d/sub/sub" "(null)" &&\n' span_id: 1423 ) (Token id:Id.Lit_Chars val:'\ttry_case 14d/sub/sub unset "$here/14d/.git" \\\n' span_id:1424) (Token id: Id.Lit_Chars val: '\t\t"$here/14d.git" "$here/14d/wt" "$here/14d/sub/sub" "(null)" &&\n' span_id: 1425 ) (Token id:Id.Lit_Chars val:'\n' span_id:1426) (Token id: Id.Lit_Chars val: '\tsetup_repo 14e "$here" gitfile unset &&\n' span_id: 1427 ) (Token id:Id.Lit_Chars val:'\ttry_case 14e unset .git \\\n' span_id:1428) (Token id: Id.Lit_Chars val: '\t\t"$here/14e.git" "$here" "$here" 14e/ &&\n' span_id: 1429 ) (Token id:Id.Lit_Chars val:'\ttry_case 14e unset "$here/14e/.git" \\\n' span_id:1430) (Token id: Id.Lit_Chars val: '\t\t"$here/14e.git" "$here" "$here" 14e/ &&\n' span_id: 1431 ) (Token id:Id.Lit_Chars val:'\ttry_case 14e/sub/sub unset ../../.git \\\n' span_id:1432) (Token id: Id.Lit_Chars val: '\t\t"$here/14e.git" "$here" "$here" 14e/sub/sub/ &&\n' span_id: 1433 ) (Token id:Id.Lit_Chars val:'\ttry_case 14e/sub/sub unset "$here/14e/.git" \\\n' span_id:1434) (Token id: Id.Lit_Chars val: '\t\t"$here/14e.git" "$here" "$here" 14e/sub/sub/\n' span_id: 1435 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#14b: core.worktree is relative to actual git dir' span_id: 1442 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1446) (Token id: Id.Lit_Chars val: '\tsetup_repo 14b ../14b gitfile unset &&\n' span_id: 1447 ) (Token id:Id.Lit_Chars val:'\ttry_case 14b unset .git \\\n' span_id:1448) (Token id: Id.Lit_Chars val: '\t\t"$here/14b.git" "$here/14b" "$here/14b" "(null)" &&\n' span_id: 1449 ) (Token id:Id.Lit_Chars val:'\ttry_case 14b unset "$here/14b/.git" \\\n' span_id:1450) (Token id: Id.Lit_Chars val: '\t\t"$here/14b.git" "$here/14b" "$here/14b" "(null)" &&\n' span_id: 1451 ) (Token id:Id.Lit_Chars val:'\ttry_case 14b/sub/sub unset ../../.git \\\n' span_id:1452) (Token id: Id.Lit_Chars val: '\t\t"$here/14b.git" "$here/14b" "$here/14b" sub/sub/ &&\n' span_id: 1453 ) (Token id:Id.Lit_Chars val:'\ttry_case 14b/sub/sub unset "$here/14b/.git" \\\n' span_id:1454) (Token id: Id.Lit_Chars val: '\t\t"$here/14b.git" "$here/14b" "$here/14b" sub/sub/ &&\n' span_id: 1455 ) (Token id:Id.Lit_Chars val:'\n' span_id:1456) (Token id: Id.Lit_Chars val: '\tsetup_repo 14f ../ gitfile unset &&\n' span_id: 1457 ) (Token id:Id.Lit_Chars val:'\ttry_case 14f unset .git \\\n' span_id:1458) (Token id: Id.Lit_Chars val: '\t\t"$here/14f.git" "$here" "$here" 14f/ &&\n' span_id: 1459 ) (Token id:Id.Lit_Chars val:'\ttry_case 14f unset "$here/14f/.git" \\\n' span_id:1460) (Token id: Id.Lit_Chars val: '\t\t"$here/14f.git" "$here" "$here" 14f/ &&\n' span_id: 1461 ) (Token id:Id.Lit_Chars val:'\ttry_case 14f/sub/sub unset ../../.git \\\n' span_id:1462) (Token id: Id.Lit_Chars val: '\t\t"$here/14f.git" "$here" "$here" 14f/sub/sub/ &&\n' span_id: 1463 ) (Token id:Id.Lit_Chars val:'\ttry_case 14f/sub/sub unset "$here/14f/.git" \\\n' span_id:1464) (Token id: Id.Lit_Chars val: '\t\t"$here/14f.git" "$here" "$here" 14f/sub/sub/\n' span_id: 1465 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#15: setup' span_id:1475))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1479) (Token id: Id.Lit_Chars val: '\tsetup_repo 15 non-existent gitfile unset &&\n' span_id: 1480 ) (Token id:Id.Lit_Chars val:'\tmkdir -p 15/sub/sub 15/wt/sub\n' span_id:1481) ) } ) (C {(run_wt_tests)} {(15)} {(gitfile)}) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#16a: implicitly bare repo (cwd inside .git dir)' span_id: 1494 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1498) (Token id:Id.Lit_Chars val:'\tsetup_repo 16a unset "" unset &&\n' span_id:1499) (Token id:Id.Lit_Chars val:'\tmkdir -p 16a/.git/wt/sub &&\n' span_id:1500) (Token id:Id.Lit_Chars val:'\n' span_id:1501) (Token id:Id.Lit_Chars val:'\ttry_case 16a/.git unset unset \\\n' span_id:1502) (Token id: Id.Lit_Chars val: '\t\t. "(null)" "$here/16a/.git" "(null)" &&\n' span_id: 1503 ) (Token id:Id.Lit_Chars val:'\ttry_case 16a/.git/wt unset unset \\\n' span_id:1504) (Token id: Id.Lit_Chars val: '\t\t"$here/16a/.git" "(null)" "$here/16a/.git/wt" "(null)" &&\n' span_id: 1505 ) (Token id:Id.Lit_Chars val:'\ttry_case 16a/.git/wt/sub unset unset \\\n' span_id:1506) (Token id: Id.Lit_Chars val: '\t\t"$here/16a/.git" "(null)" "$here/16a/.git/wt/sub" "(null)"\n' span_id: 1507 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#16b: bare .git (cwd inside .git dir)' span_id:1514))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1518) (Token id:Id.Lit_Chars val:'\tsetup_repo 16b unset "" true &&\n' span_id:1519) (Token id:Id.Lit_Chars val:'\tmkdir -p 16b/.git/wt/sub &&\n' span_id:1520) (Token id:Id.Lit_Chars val:'\n' span_id:1521) (Token id:Id.Lit_Chars val:'\ttry_case 16b/.git unset unset \\\n' span_id:1522) (Token id: Id.Lit_Chars val: '\t\t. "(null)" "$here/16b/.git" "(null)" &&\n' span_id: 1523 ) (Token id:Id.Lit_Chars val:'\ttry_case 16b/.git/wt unset unset \\\n' span_id:1524) (Token id: Id.Lit_Chars val: '\t\t"$here/16b/.git" "(null)" "$here/16b/.git/wt" "(null)" &&\n' span_id: 1525 ) (Token id:Id.Lit_Chars val:'\ttry_case 16b/.git/wt/sub unset unset \\\n' span_id:1526) (Token id: Id.Lit_Chars val: '\t\t"$here/16b/.git" "(null)" "$here/16b/.git/wt/sub" "(null)"\n' span_id: 1527 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#16c: bare .git has no worktree' span_id:1534))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1538) (Token id: Id.Lit_Chars val: '\ttry_repo 16c unset unset unset "" true \\\n' span_id: 1539 ) (Token id:Id.Lit_Chars val:'\t\t.git "(null)" "$here/16c" "(null)" \\\n' span_id:1540) (Token id: Id.Lit_Chars val: '\t\t"$here/16c/.git" "(null)" "$here/16c/sub" "(null)"\n' span_id: 1541 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#16d: bareness preserved across alias' span_id:1548))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1552) (Token id:Id.Lit_Chars val:'\tsetup_repo 16d unset "" unset &&\n' span_id:1553) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1554) (Token id:Id.Lit_Chars val:'\t\tcd 16d/.git &&\n' span_id:1555) (Token id:Id.Lit_Chars val:'\t\ttest_must_fail git status &&\n' span_id:1556) (Token id:Id.Lit_Chars val:'\t\tgit config alias.st status &&\n' span_id:1557) (Token id:Id.Lit_Chars val:'\t\ttest_must_fail git st\n' span_id:1558) (Token id:Id.Lit_Chars val:'\t)\n' span_id:1559) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#16e: bareness preserved by --bare' span_id:1566))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1570) (Token id:Id.Lit_Chars val:'\tsetup_repo 16e unset "" unset &&\n' span_id:1571) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1572) (Token id:Id.Lit_Chars val:'\t\tcd 16e/.git &&\n' span_id:1573) (Token id:Id.Lit_Chars val:'\t\ttest_must_fail git status &&\n' span_id:1574) (Token id:Id.Lit_Chars val:'\t\ttest_must_fail git --bare status\n' span_id:1575) (Token id:Id.Lit_Chars val:'\t)\n' span_id:1576) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#17: GIT_WORK_TREE without explicit GIT_DIR is accepted (bare case)' span_id: 1583 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1587) (Token id:Id.Lit_Chars val:'\t# Just like #16.\n' span_id:1588) (Token id:Id.Lit_Chars val:'\tsetup_repo 17a unset "" true &&\n' span_id:1589) (Token id:Id.Lit_Chars val:'\tsetup_repo 17b unset "" true &&\n' span_id:1590) (Token id:Id.Lit_Chars val:'\tmkdir -p 17a/.git/wt/sub &&\n' span_id:1591) (Token id:Id.Lit_Chars val:'\tmkdir -p 17b/.git/wt/sub &&\n' span_id:1592) (Token id:Id.Lit_Chars val:'\n' span_id:1593) (Token id: Id.Lit_Chars val: '\ttry_case 17a/.git "$here/17a" unset \\\n' span_id: 1594 ) (Token id:Id.Lit_Chars val:'\t\t"$here/17a/.git" "$here/17a" "$here/17a" .git/ \\\n' span_id:1595) (Token id:Id.Lit_Chars val:'\t\t2>message &&\n' span_id:1596) (Token id:Id.Lit_Chars val:'\ttry_case 17a/.git/wt "$here/17a" unset \\\n' span_id:1597) (Token id: Id.Lit_Chars val: '\t\t"$here/17a/.git" "$here/17a" "$here/17a" .git/wt/ &&\n' span_id: 1598 ) (Token id:Id.Lit_Chars val:'\ttry_case 17a/.git/wt/sub "$here/17a" unset \\\n' span_id:1599) (Token id: Id.Lit_Chars val: '\t\t"$here/17a/.git" "$here/17a" "$here/17a" .git/wt/sub/ &&\n' span_id: 1600 ) (Token id:Id.Lit_Chars val:'\n' span_id:1601) (Token id: Id.Lit_Chars val: '\ttry_case 17b/.git "$here/17b" unset \\\n' span_id: 1602 ) (Token id:Id.Lit_Chars val:'\t\t"$here/17b/.git" "$here/17b" "$here/17b" .git/ &&\n' span_id:1603) (Token id: Id.Lit_Chars val: '\ttry_case 17b/.git/wt "$here/17b" unset \\\n' span_id: 1604 ) (Token id:Id.Lit_Chars val:'\t\t"$here/17b/.git" "$here/17b" "$here/17b" .git/wt/ &&\n' span_id:1605) (Token id: Id.Lit_Chars val: '\ttry_case 17b/.git/wt/sub "$here/17b" unset \\\n' span_id: 1606 ) (Token id: Id.Lit_Chars val: '\t\t"$here/17b/.git" "$here/17b" "$here/17b" .git/wt/sub/ &&\n' span_id: 1607 ) (Token id:Id.Lit_Chars val:'\n' span_id:1608) (Token id: Id.Lit_Chars val: '\ttry_repo 17c "$here/17c" unset unset "" true \\\n' span_id: 1609 ) (Token id:Id.Lit_Chars val:'\t\t.git "$here/17c" "$here/17c" "(null)" \\\n' span_id:1610) (Token id: Id.Lit_Chars val: '\t\t"$here/17c/.git" "$here/17c" "$here/17c" sub/ 2>message &&\n' span_id: 1611 ) (Token id:Id.Lit_Chars val:'\t! test -s message\n' span_id:1612) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#18: bare .git named by GIT_DIR has no worktree' span_id: 1619 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1623) (Token id: Id.Lit_Chars val: '\ttry_repo 18 unset .git unset "" true \\\n' span_id: 1624 ) (Token id:Id.Lit_Chars val:'\t\t.git "(null)" "$here/18" "(null)" \\\n' span_id:1625) (Token id: Id.Lit_Chars val: '\t\t../.git "(null)" "$here/18/sub" "(null)" &&\n' span_id: 1626 ) (Token id:Id.Lit_Chars val:'\ttry_repo 18b unset "$here/18b/.git" unset "" true \\\n' span_id:1627) (Token id: Id.Lit_Chars val: '\t\t"$here/18b/.git" "(null)" "$here/18b" "(null)" \\\n' span_id: 1628 ) (Token id:Id.Lit_Chars val:'\t\t"$here/18b/.git" "(null)" "$here/18b/sub" "(null)"\n' span_id:1629) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#19: setup' span_id:1639))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1643) (Token id:Id.Lit_Chars val:'\tsetup_repo 19 unset "" true &&\n' span_id:1644) (Token id:Id.Lit_Chars val:'\tmkdir -p 19/sub/sub 19/wt/sub\n' span_id:1645) ) } ) (C {(run_wt_tests)} {(19)}) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#20a: core.worktree without GIT_DIR accepted (inside .git)' span_id: 1656 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1660) (Token id:Id.Lit_Chars val:'\t# Unlike case #16a.\n' span_id:1661) (Token id:Id.Lit_Chars val:'\tsetup_repo 20a "$here/20a" "" unset &&\n' span_id:1662) (Token id:Id.Lit_Chars val:'\tmkdir -p 20a/.git/wt/sub &&\n' span_id:1663) (Token id:Id.Lit_Chars val:'\ttry_case 20a/.git unset unset \\\n' span_id:1664) (Token id: Id.Lit_Chars val: '\t\t"$here/20a/.git" "$here/20a" "$here/20a" .git/ 2>message &&\n' span_id: 1665 ) (Token id:Id.Lit_Chars val:'\ttry_case 20a/.git/wt unset unset \\\n' span_id:1666) (Token id: Id.Lit_Chars val: '\t\t"$here/20a/.git" "$here/20a" "$here/20a" .git/wt/ &&\n' span_id: 1667 ) (Token id:Id.Lit_Chars val:'\ttry_case 20a/.git/wt/sub unset unset \\\n' span_id:1668) (Token id: Id.Lit_Chars val: '\t\t"$here/20a/.git" "$here/20a" "$here/20a" .git/wt/sub/ &&\n' span_id: 1669 ) (Token id:Id.Lit_Chars val:'\t! test -s message\n' span_id:1670) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#20b/c: core.worktree and core.bare conflict' span_id:1677))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1681) (Token id: Id.Lit_Chars val: '\tsetup_repo 20b non-existent "" true &&\n' span_id: 1682 ) (Token id:Id.Lit_Chars val:'\tmkdir -p 20b/.git/wt/sub &&\n' span_id:1683) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1684) (Token id:Id.Lit_Chars val:'\t\tcd 20b/.git &&\n' span_id:1685) (Token id: Id.Lit_Chars val: '\t\ttest_must_fail git status >/dev/null\n' span_id: 1686 ) (Token id:Id.Lit_Chars val:'\t) 2>message &&\n' span_id:1687) (Token id: Id.Lit_Chars val: '\tgrep "core.bare and core.worktree" message\n' span_id: 1688 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#20d: core.worktree and core.bare OK when working tree not needed' span_id: 1695 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1699) (Token id: Id.Lit_Chars val: '\tsetup_repo 20d non-existent "" true &&\n' span_id: 1700 ) (Token id:Id.Lit_Chars val:'\tmkdir -p 20d/.git/wt/sub &&\n' span_id:1701) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1702) (Token id:Id.Lit_Chars val:'\t\tcd 20d/.git &&\n' span_id:1703) (Token id:Id.Lit_Chars val:'\t\tgit config foo.bar value\n' span_id:1704) (Token id:Id.Lit_Chars val:'\t)\n' span_id:1705) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#21: setup, core.worktree warns before overriding core.bare' span_id: 1715 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1719) (Token id: Id.Lit_Chars val: '\tsetup_repo 21 non-existent "" unset &&\n' span_id: 1720 ) (Token id:Id.Lit_Chars val:'\tmkdir -p 21/.git/wt/sub &&\n' span_id:1721) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1722) (Token id:Id.Lit_Chars val:'\t\tcd 21/.git &&\n' span_id:1723) (Token id:Id.Lit_Chars val:'\t\tGIT_WORK_TREE="$here/21" &&\n' span_id:1724) (Token id:Id.Lit_Chars val:'\t\texport GIT_WORK_TREE &&\n' span_id:1725) (Token id:Id.Lit_Chars val:'\t\tgit status >/dev/null\n' span_id:1726) (Token id:Id.Lit_Chars val:'\t) 2>message &&\n' span_id:1727) (Token id:Id.Lit_Chars val:'\t! test -s message\n' span_id:1728) (Token id:Id.Lit_Chars val:'\n' span_id:1729) ) } ) (C {(run_wt_tests)} {(21)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#22a: core.worktree = GIT_DIR = .git dir' span_id:1740))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1744) (Token id:Id.Lit_Chars val:'\t# like case #6.\n' span_id:1745) (Token id:Id.Lit_Chars val:'\n' span_id:1746) (Token id: Id.Lit_Chars val: '\tsetup_repo 22a "$here/22a/.git" "" unset &&\n' span_id: 1747 ) (Token id:Id.Lit_Chars val:'\tsetup_repo 22ab . "" unset &&\n' span_id:1748) (Token id:Id.Lit_Chars val:'\tmkdir -p 22a/.git/sub 22a/sub &&\n' span_id:1749) (Token id:Id.Lit_Chars val:'\tmkdir -p 22ab/.git/sub 22ab/sub &&\n' span_id:1750) (Token id:Id.Lit_Chars val:'\ttry_case 22a/.git unset . \\\n' span_id:1751) (Token id:Id.Lit_Chars val:'\t\t. "$here/22a/.git" "$here/22a/.git" "(null)" &&\n' span_id:1752) (Token id: Id.Lit_Chars val: '\ttry_case 22a/.git unset "$here/22a/.git" \\\n' span_id: 1753 ) (Token id: Id.Lit_Chars val: '\t\t"$here/22a/.git" "$here/22a/.git" "$here/22a/.git" "(null)" &&\n' span_id: 1754 ) (Token id:Id.Lit_Chars val:'\ttry_case 22a/.git/sub unset .. \\\n' span_id:1755) (Token id: Id.Lit_Chars val: '\t\t"$here/22a/.git" "$here/22a/.git" "$here/22a/.git" sub/ &&\n' span_id: 1756 ) (Token id:Id.Lit_Chars val:'\ttry_case 22a/.git/sub unset "$here/22a/.git" \\\n' span_id:1757) (Token id: Id.Lit_Chars val: '\t\t"$here/22a/.git" "$here/22a/.git" "$here/22a/.git" sub/ &&\n' span_id: 1758 ) (Token id:Id.Lit_Chars val:'\n' span_id:1759) (Token id:Id.Lit_Chars val:'\ttry_case 22ab/.git unset . \\\n' span_id:1760) (Token id:Id.Lit_Chars val:'\t\t. "$here/22ab/.git" "$here/22ab/.git" "(null)" &&\n' span_id:1761) (Token id: Id.Lit_Chars val: '\ttry_case 22ab/.git unset "$here/22ab/.git" \\\n' span_id: 1762 ) (Token id: Id.Lit_Chars val: '\t\t"$here/22ab/.git" "$here/22ab/.git" "$here/22ab/.git" "(null)" &&\n' span_id: 1763 ) (Token id:Id.Lit_Chars val:'\ttry_case 22ab/.git/sub unset .. \\\n' span_id:1764) (Token id: Id.Lit_Chars val: '\t\t"$here/22ab/.git" "$here/22ab/.git" "$here/22ab/.git" sub/ &&\n' span_id: 1765 ) (Token id:Id.Lit_Chars val:'\ttry_case 22ab/.git unset "$here/22ab/.git" \\\n' span_id:1766) (Token id: Id.Lit_Chars val: '\t\t"$here/22ab/.git" "$here/22ab/.git" "$here/22ab/.git" "(null)"\n' span_id: 1767 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#22b: core.worktree child of .git, GIT_DIR=.git' span_id: 1774 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1778) (Token id: Id.Lit_Chars val: '\tsetup_repo 22b "$here/22b/.git/wt" "" unset &&\n' span_id: 1779 ) (Token id:Id.Lit_Chars val:'\tsetup_repo 22bb wt "" unset &&\n' span_id:1780) (Token id: Id.Lit_Chars val: '\tmkdir -p 22b/.git/sub 22b/sub 22b/.git/wt/sub 22b/wt/sub &&\n' span_id: 1781 ) (Token id: Id.Lit_Chars val: '\tmkdir -p 22bb/.git/sub 22bb/sub 22bb/.git/wt 22bb/wt &&\n' span_id: 1782 ) (Token id:Id.Lit_Chars val:'\n' span_id:1783) (Token id:Id.Lit_Chars val:'\ttry_case 22b/.git unset . \\\n' span_id:1784) (Token id:Id.Lit_Chars val:'\t\t. "$here/22b/.git/wt" "$here/22b/.git" "(null)" &&\n' span_id:1785) (Token id: Id.Lit_Chars val: '\ttry_case 22b/.git unset "$here/22b/.git" \\\n' span_id: 1786 ) (Token id: Id.Lit_Chars val: '\t\t"$here/22b/.git" "$here/22b/.git/wt" "$here/22b/.git" "(null)" &&\n' span_id: 1787 ) (Token id:Id.Lit_Chars val:'\ttry_case 22b/.git/sub unset .. \\\n' span_id:1788) (Token id: Id.Lit_Chars val: '\t\t.. "$here/22b/.git/wt" "$here/22b/.git/sub" "(null)" &&\n' span_id: 1789 ) (Token id:Id.Lit_Chars val:'\ttry_case 22b/.git/sub unset "$here/22b/.git" \\\n' span_id:1790) (Token id: Id.Lit_Chars val: '\t\t"$here/22b/.git" "$here/22b/.git/wt" "$here/22b/.git/sub" "(null)" &&\n' span_id: 1791 ) (Token id:Id.Lit_Chars val:'\n' span_id:1792) (Token id:Id.Lit_Chars val:'\ttry_case 22bb/.git unset . \\\n' span_id:1793) (Token id:Id.Lit_Chars val:'\t\t. "$here/22bb/.git/wt" "$here/22bb/.git" "(null)" &&\n' span_id:1794) (Token id: Id.Lit_Chars val: '\ttry_case 22bb/.git unset "$here/22bb/.git" \\\n' span_id: 1795 ) (Token id: Id.Lit_Chars val: '\t\t"$here/22bb/.git" "$here/22bb/.git/wt" "$here/22bb/.git" "(null)" &&\n' span_id: 1796 ) (Token id:Id.Lit_Chars val:'\ttry_case 22bb/.git/sub unset .. \\\n' span_id:1797) (Token id: Id.Lit_Chars val: '\t\t.. "$here/22bb/.git/wt" "$here/22bb/.git/sub" "(null)" &&\n' span_id: 1798 ) (Token id:Id.Lit_Chars val:'\ttry_case 22bb/.git/sub unset "$here/22bb/.git" \\\n' span_id:1799) (Token id: Id.Lit_Chars val: '\t\t"$here/22bb/.git" "$here/22bb/.git/wt" "$here/22bb/.git/sub" "(null)"\n' span_id: 1800 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#22c: core.worktree = .git/.., GIT_DIR=.git' span_id:1807))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1811) (Token id: Id.Lit_Chars val: '\tsetup_repo 22c "$here/22c" "" unset &&\n' span_id: 1812 ) (Token id:Id.Lit_Chars val:'\tsetup_repo 22cb .. "" unset &&\n' span_id:1813) (Token id:Id.Lit_Chars val:'\tmkdir -p 22c/.git/sub 22c/sub &&\n' span_id:1814) (Token id:Id.Lit_Chars val:'\tmkdir -p 22cb/.git/sub 22cb/sub &&\n' span_id:1815) (Token id:Id.Lit_Chars val:'\n' span_id:1816) (Token id:Id.Lit_Chars val:'\ttry_case 22c/.git unset . \\\n' span_id:1817) (Token id: Id.Lit_Chars val: '\t\t"$here/22c/.git" "$here/22c" "$here/22c" .git/ &&\n' span_id: 1818 ) (Token id:Id.Lit_Chars val:'\ttry_case 22c/.git unset "$here/22c/.git" \\\n' span_id:1819) (Token id: Id.Lit_Chars val: '\t\t"$here/22c/.git" "$here/22c" "$here/22c" .git/ &&\n' span_id: 1820 ) (Token id:Id.Lit_Chars val:'\ttry_case 22c/.git/sub unset .. \\\n' span_id:1821) (Token id: Id.Lit_Chars val: '\t\t"$here/22c/.git" "$here/22c" "$here/22c" .git/sub/ &&\n' span_id: 1822 ) (Token id:Id.Lit_Chars val:'\ttry_case 22c/.git/sub unset "$here/22c/.git" \\\n' span_id:1823) (Token id: Id.Lit_Chars val: '\t\t"$here/22c/.git" "$here/22c" "$here/22c" .git/sub/ &&\n' span_id: 1824 ) (Token id:Id.Lit_Chars val:'\n' span_id:1825) (Token id:Id.Lit_Chars val:'\ttry_case 22cb/.git unset . \\\n' span_id:1826) (Token id:Id.Lit_Chars val:'\t\t"$here/22cb/.git" "$here/22cb" "$here/22cb" .git/ &&\n' span_id:1827) (Token id: Id.Lit_Chars val: '\ttry_case 22cb/.git unset "$here/22cb/.git" \\\n' span_id: 1828 ) (Token id:Id.Lit_Chars val:'\t\t"$here/22cb/.git" "$here/22cb" "$here/22cb" .git/ &&\n' span_id:1829) (Token id:Id.Lit_Chars val:'\ttry_case 22cb/.git/sub unset .. \\\n' span_id:1830) (Token id: Id.Lit_Chars val: '\t\t"$here/22cb/.git" "$here/22cb" "$here/22cb" .git/sub/ &&\n' span_id: 1831 ) (Token id:Id.Lit_Chars val:'\ttry_case 22cb/.git/sub unset "$here/22cb/.git" \\\n' span_id:1832) (Token id: Id.Lit_Chars val: '\t\t"$here/22cb/.git" "$here/22cb" "$here/22cb" .git/sub/\n' span_id: 1833 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#22.2: core.worktree and core.bare conflict' span_id:1840))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1844) (Token id: Id.Lit_Chars val: '\tsetup_repo 22 "$here/22" "" true &&\n' span_id: 1845 ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1846) (Token id:Id.Lit_Chars val:'\t\tcd 22/.git &&\n' span_id:1847) (Token id:Id.Lit_Chars val:'\t\tGIT_DIR=. &&\n' span_id:1848) (Token id:Id.Lit_Chars val:'\t\texport GIT_DIR &&\n' span_id:1849) (Token id:Id.Lit_Chars val:'\t\ttest_must_fail git status 2>result\n' span_id:1850) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1851) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1852) (Token id:Id.Lit_Chars val:'\t\tcd 22 &&\n' span_id:1853) (Token id:Id.Lit_Chars val:'\t\tGIT_DIR=.git &&\n' span_id:1854) (Token id:Id.Lit_Chars val:'\t\texport GIT_DIR &&\n' span_id:1855) (Token id:Id.Lit_Chars val:'\t\ttest_must_fail git status 2>result\n' span_id:1856) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1857) (Token id:Id.Lit_Chars val:'\tgrep "core.bare and core.worktree" 22/.git/result &&\n' span_id:1858) (Token id: Id.Lit_Chars val: '\tgrep "core.bare and core.worktree" 22/result\n' span_id: 1859 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#23: setup' span_id:1869))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1873) (Token id: Id.Lit_Chars val: '\tsetup_repo 23 non-existent "" true &&\n' span_id: 1874 ) (Token id:Id.Lit_Chars val:'\tmkdir -p 23/sub/sub 23/wt/sub\n' span_id:1875) ) } ) (C {(run_wt_tests)} {(23)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#24: bare repo has no worktree (gitfile case)' span_id:1886))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1890) (Token id: Id.Lit_Chars val: '\ttry_repo 24 unset unset unset gitfile true \\\n' span_id: 1891 ) (Token id:Id.Lit_Chars val:'\t\t"$here/24.git" "(null)" "$here/24" "(null)" \\\n' span_id:1892) (Token id: Id.Lit_Chars val: '\t\t"$here/24.git" "(null)" "$here/24/sub" "(null)"\n' span_id: 1893 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#25: GIT_WORK_TREE accepted if GIT_DIR unset (bare gitfile case)' span_id: 1900 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1904) (Token id: Id.Lit_Chars val: '\ttry_repo 25 "$here/25" unset unset gitfile true \\\n' span_id: 1905 ) (Token id:Id.Lit_Chars val:'\t\t"$here/25.git" "$here/25" "$here/25" "(null)" \\\n' span_id:1906) (Token id: Id.Lit_Chars val: '\t\t"$here/25.git" "$here/25" "$here/25" "sub/" 2>message &&\n' span_id: 1907 ) (Token id:Id.Lit_Chars val:'\t! test -s message\n' span_id:1908) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#26: bare repo has no worktree (GIT_DIR -> gitfile case)' span_id: 1915 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1919) (Token id: Id.Lit_Chars val: '\ttry_repo 26 unset "$here/26/.git" unset gitfile true \\\n' span_id: 1920 ) (Token id:Id.Lit_Chars val:'\t\t"$here/26.git" "(null)" "$here/26" "(null)" \\\n' span_id:1921) (Token id: Id.Lit_Chars val: '\t\t"$here/26.git" "(null)" "$here/26/sub" "(null)" &&\n' span_id: 1922 ) (Token id:Id.Lit_Chars val:'\ttry_repo 26b unset .git unset gitfile true \\\n' span_id:1923) (Token id: Id.Lit_Chars val: '\t\t"$here/26b.git" "(null)" "$here/26b" "(null)" \\\n' span_id: 1924 ) (Token id:Id.Lit_Chars val:'\t\t"$here/26b.git" "(null)" "$here/26b/sub" "(null)"\n' span_id:1925) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#27: setup' span_id:1935))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1939) (Token id: Id.Lit_Chars val: '\tsetup_repo 27 unset gitfile true &&\n' span_id: 1940 ) (Token id:Id.Lit_Chars val:'\tmkdir -p 27/sub/sub 27/wt/sub\n' span_id:1941) ) } ) (C {(run_wt_tests)} {(27)} {(gitfile)}) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#28: core.worktree and core.bare conflict (gitfile case)' span_id: 1954 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1958) (Token id: Id.Lit_Chars val: '\tsetup_repo 28 "$here/28" gitfile true &&\n' span_id: 1959 ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1960) (Token id:Id.Lit_Chars val:'\t\tcd 28 &&\n' span_id:1961) (Token id:Id.Lit_Chars val:'\t\ttest_must_fail git status\n' span_id:1962) (Token id:Id.Lit_Chars val:'\t) 2>message &&\n' span_id:1963) (Token id:Id.Lit_Chars val:'\tgrep "core.bare and core.worktree" message\n' span_id:1964) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#29: setup' span_id:1974))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1978) (Token id: Id.Lit_Chars val: '\tsetup_repo 29 non-existent gitfile true &&\n' span_id: 1979 ) (Token id:Id.Lit_Chars val:'\tmkdir -p 29/sub/sub 29/wt/sub &&\n' span_id:1980) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1981) (Token id:Id.Lit_Chars val:'\t\tcd 29 &&\n' span_id:1982) (Token id:Id.Lit_Chars val:'\t\tGIT_WORK_TREE="$here/29" &&\n' span_id:1983) (Token id:Id.Lit_Chars val:'\t\texport GIT_WORK_TREE &&\n' span_id:1984) (Token id:Id.Lit_Chars val:'\t\tgit status\n' span_id:1985) (Token id:Id.Lit_Chars val:'\t) 2>message &&\n' span_id:1986) (Token id:Id.Lit_Chars val:'\t! test -s message\n' span_id:1987) ) } ) (C {(run_wt_tests)} {(29)} {(gitfile)}) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '#30: core.worktree and core.bare conflict (gitfile version)' span_id: 2000 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2004) (Token id:Id.Lit_Chars val:'\t# Just like case #22.\n' span_id:2005) (Token id:Id.Lit_Chars val:'\tsetup_repo 30 "$here/30" gitfile true &&\n' span_id:2006) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2007) (Token id:Id.Lit_Chars val:'\t\tcd 30 &&\n' span_id:2008) (Token id: Id.Lit_Chars val: '\t\ttest_must_fail env GIT_DIR=.git git status 2>result\n' span_id: 2009 ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:2010) (Token id: Id.Lit_Chars val: '\tgrep "core.bare and core.worktree" 30/result\n' span_id: 2011 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'#31: setup' span_id:2024))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2028) (Token id: Id.Lit_Chars val: '\tsetup_repo 31 non-existent gitfile true &&\n' span_id: 2029 ) (Token id:Id.Lit_Chars val:'\tmkdir -p 31/sub/sub 31/wt/sub\n' span_id:2030) ) } ) (C {(run_wt_tests)} {(31)} {(gitfile)}) (C {(test_done)}) ] )