(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ (Token id:Id.Lit_Chars val:'Test various path utilities' span_id:15))} spids: [13] ) ] ) (C {(.)} {(./test-lib.sh)}) (command.ShFunction name: norm_path body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expected) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:32) command_list: (command.CommandList children: [ (C {(test-path-utils)} {(print_path)} {(DQ ($ Id.VSub_Number '$2'))}) ] ) ) } spids: [31] ) ] ) (C {(test_expect_success)} {($ Id.VSub_Number '$3')} {(DQ ('normalize path: ') ($ Id.VSub_Number '$1') (' => ') ($ Id.VSub_Number '$2'))} { (DQ ('test ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:58) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\$' span_id:59)) ("(test-path-utils normalize_path_copy '") ($ Id.VSub_Number '$1') ("')") (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:63) ) (" = '") ($ Id.VSub_DollarName '$expected') ("'") ) } ) ] ) ) (command.ShFunction name: relative_path body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expected) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:80) command_list: (command.CommandList children: [ (C {(test-path-utils)} {(print_path)} {(DQ ($ Id.VSub_Number '$3'))}) ] ) ) } spids: [79] ) ] ) (C {(test_expect_success)} {($ Id.VSub_Number '$4')} { (DQ ('relative path: ') ($ Id.VSub_Number '$1') (' ') ($ Id.VSub_Number '$2') (' => ') ($ Id.VSub_Number '$3') ) } { (DQ ('test ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:108) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\$' span_id:109)) ("(test-path-utils relative_path '") ($ Id.VSub_Number '$1') ("' '") ($ Id.VSub_Number '$2') ("')") (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:115) ) (" = '") ($ Id.VSub_DollarName '$expected') ("'") ) } ) ] ) ) (command.ShFunction name: test_submodule_relative_url body: (command.BraceGroup children: [ (C {(test_expect_success)} { (DQ ('test_submodule_relative_url: ') ($ Id.VSub_Number '$1') (' ') ($ Id.VSub_Number '$2') (' ') ($ Id.VSub_Number '$3') (' => ') ($ Id.VSub_Number '$4') ) } { (DQ ('\n') ('\t\tactual=') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:147) ) ("(git submodule--helper resolve-relative-url-test '") ($ Id.VSub_Number '$1') ("' '") ($ Id.VSub_Number '$2') ("' '") ($ Id.VSub_Number '$3') ("') &&\n") ('\t\ttest ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:156) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\$' span_id:157)) (actual) (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:159) ) (" = '") ($ Id.VSub_Number '$4') ("'\n") ('\t') ) } ) ] ) ) (command.ShFunction name: test_git_path body: (command.BraceGroup children: [ (C {(test_expect_success)} { (DQ ('git-path ') ($ Id.VSub_Number '$1') (' ') ($ Id.VSub_Number '$2') (' => ') ($ Id.VSub_Number '$3') ) } { (DQ ('\n') ('\t\t') ($ Id.VSub_Number '$1') (' git rev-parse --git-path ') ($ Id.VSub_Number '$2') (' >actual &&\n') ('\t\techo ') ($ Id.VSub_Number '$3') (' >expect &&\n') ('\t\ttest_cmp expect actual\n') ('\t') ) } ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:rootoff) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:214) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(test-path-utils)} {(normalize_path_copy)} {(/)}) (C {(wc)} {(-c)}) ] negated: F ) ] ) ) } spids: [213] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(test)} {($ Id.VSub_DollarName '$rootoff')} {(Id.Lit_Equals '=')} {(2)}) terminator: (Token id:Id.Op_Semi val:';' span_id:240) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:rootoff) op: assign_op.Equal rhs: (word.Empty) spids: [245] ) ] ) ] spids: [231 242] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:rootoff) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$rootoff')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [253] ) ] ) (command.Case to_match: { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:277) command_list: (command.CommandList children: [(C {(test-path-utils)} {(print_path)} {(/)})] ) ) ) } arms: [ (case_arm pat_list: [{(Id.Lit_Star '*') (/)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:rootslash) op: assign_op.Equal rhs: {(1)} spids: [293] ) ] ) ] spids: [289 291 295 -1] ) (case_arm pat_list: [{(Id.Lit_Star '*')}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:rootslash) op: assign_op.Equal rhs: {(0)} spids: [301] ) ] ) ] spids: [298 299 303 -1] ) ] ) ] ) (command.ShFunction name: ancestor body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expected) op: assign_op.Equal rhs: {($ Id.VSub_Number '$3')} spids: [322] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(test)} {(-n)} {(DQ ($ Id.VSub_DollarName '$rootoff'))}) (C {(test)} {(DQ (x) ($ Id.VSub_DollarName '$expected'))} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(x-1)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:349) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expected) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$expected')}) right: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$rootslash')} ) ) ) } spids: [354] ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(test)} {($ Id.VSub_DollarName '$expected')} {(-lt)} {(0)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expected) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$expected')} ) right: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$rootoff')} ) ) ) } spids: [374] ) ] ) ] ) ] spids: [326 351] ) ] ) (C {(test_expect_success)} { (DQ ('longest ancestor: ') ($ Id.VSub_Number '$1') (' ') ($ Id.VSub_Number '$2') (' => ') ($ Id.VSub_DollarName '$expected') ) } { (DQ ('actual=') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:401) ) ("(test-path-utils longest_ancestor_length '") ($ Id.VSub_Number '$1') ("' '") ($ Id.VSub_Number '$2') ("') &&\n") ('\t test ') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:408)) (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:409) ) (actual) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:411)) (" = '") ($ Id.VSub_DollarName '$expected') ("'") ) } ) ] ) ) (command.Case to_match: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:428) command_list: (command.CommandList children:[(C {(uname)} {(-s)})]) ) } arms: [ (case_arm pat_list: [{(Id.Lit_Star '*') (MINGW) (Id.Lit_Star '*')}] spids: [436 439 442 -1] ) (case_arm pat_list: [{(Id.Lit_Star '*')}] action: [(C {(test_set_prereq)} {(POSIX)})] spids: [444 445 453 -1] ) ] ) (C {(test_expect_success)} {(basename)} {(SQ (Token id:Id.Lit_Chars val:'test-path-utils basename' span_id:463))} ) (C {(test_expect_success)} {(dirname)} {(SQ (Token id:Id.Lit_Chars val:'test-path-utils dirname' span_id:471))} ) (C {(norm_path)} {(DQ )} {(DQ )}) (C {(norm_path)} {(.)} {(DQ )}) (C {(norm_path)} {(./)} {(DQ )}) (C {(norm_path)} {(./.)} {(DQ )}) (C {(norm_path)} {(./..)} {(Id.Lit_Other '+') (Id.Lit_Other '+') (failed) (Id.Lit_Other '+') (Id.Lit_Other '+')} ) (C {(norm_path)} {(../.)} {(Id.Lit_Other '+') (Id.Lit_Other '+') (failed) (Id.Lit_Other '+') (Id.Lit_Other '+')} ) (C {(norm_path)} {(./.././/)} {(Id.Lit_Other '+') (Id.Lit_Other '+') (failed) (Id.Lit_Other '+') (Id.Lit_Other '+')} ) (C {(norm_path)} {(dir/..)} {(DQ )}) (C {(norm_path)} {(dir/sub/../..)} {(DQ )}) (C {(norm_path)} {(dir/sub/../../..)} {(Id.Lit_Other '+') (Id.Lit_Other '+') (failed) (Id.Lit_Other '+') (Id.Lit_Other '+')} ) (C {(norm_path)} {(dir)} {(dir)}) (C {(norm_path)} {(dir//)} {(dir/)}) (C {(norm_path)} {(./dir)} {(dir)}) (C {(norm_path)} {(dir/.)} {(dir/)}) (C {(norm_path)} {(dir///./)} {(dir/)}) (C {(norm_path)} {(dir//sub/..)} {(dir/)}) (C {(norm_path)} {(dir/sub/../)} {(dir/)}) (C {(norm_path)} {(dir/sub/../.)} {(dir/)}) (C {(norm_path)} {(dir/s1/../s2/)} {(dir/s2/)}) (C {(norm_path)} {(d1/s1///s2/..//../s3/)} {(d1/s3/)}) (C {(norm_path)} {(d1/s1//../s2/../../d2)} {(d2)}) (C {(norm_path)} {(d1/.../d2)} {(d1/.../d2)}) (C {(norm_path)} {(d1/..././../d2)} {(d1/d2)}) (C {(norm_path)} {(/)} {(/)}) (C {(norm_path)} {(//)} {(/)} {(POSIX)}) (C {(norm_path)} {(///)} {(/)} {(POSIX)}) (C {(norm_path)} {(/.)} {(/)}) (C {(norm_path)} {(/./)} {(/)} {(POSIX)}) (C {(norm_path)} {(/./..)} {(Id.Lit_Other '+') (Id.Lit_Other '+') (failed) (Id.Lit_Other '+') (Id.Lit_Other '+')} {(POSIX)} ) (C {(norm_path)} {(/../.)} {(Id.Lit_Other '+') (Id.Lit_Other '+') (failed) (Id.Lit_Other '+') (Id.Lit_Other '+')} ) (C {(norm_path)} {(/./.././/)} {(Id.Lit_Other '+') (Id.Lit_Other '+') (failed) (Id.Lit_Other '+') (Id.Lit_Other '+')} {(POSIX)} ) (C {(norm_path)} {(/dir/..)} {(/)} {(POSIX)}) (C {(norm_path)} {(/dir/sub/../..)} {(/)} {(POSIX)}) (C {(norm_path)} {(/dir/sub/../../..)} {(Id.Lit_Other '+') (Id.Lit_Other '+') (failed) (Id.Lit_Other '+') (Id.Lit_Other '+')} {(POSIX)} ) (C {(norm_path)} {(/dir)} {(/dir)}) (C {(norm_path)} {(/dir//)} {(/dir/)}) (C {(norm_path)} {(/./dir)} {(/dir)}) (C {(norm_path)} {(/dir/.)} {(/dir/)}) (C {(norm_path)} {(/dir///./)} {(/dir/)}) (C {(norm_path)} {(/dir//sub/..)} {(/dir/)}) (C {(norm_path)} {(/dir/sub/../)} {(/dir/)}) (C {(norm_path)} {(//dir/sub/../.)} {(/dir/)} {(POSIX)}) (C {(norm_path)} {(/dir/s1/../s2/)} {(/dir/s2/)}) (C {(norm_path)} {(/d1/s1///s2/..//../s3/)} {(/d1/s3/)}) (C {(norm_path)} {(/d1/s1//../s2/../../d2)} {(/d2)}) (C {(norm_path)} {(/d1/.../d2)} {(/d1/.../d2)}) (C {(norm_path)} {(/d1/..././../d2)} {(/d1/d2)}) (C {(ancestor)} {(/)} {(/)} {(-1)}) (C {(ancestor)} {(/foo)} {(/)} {(0)}) (C {(ancestor)} {(/foo)} {(/fo)} {(-1)}) (C {(ancestor)} {(/foo)} {(/foo)} {(-1)}) (C {(ancestor)} {(/foo)} {(/bar)} {(-1)}) (C {(ancestor)} {(/foo)} {(/foo/bar)} {(-1)}) (C {(ancestor)} {(/foo)} {(/foo) (Id.Lit_Other ':') (/bar)} {(-1)}) (C {(ancestor)} {(/foo)} {(/) (Id.Lit_Other ':') (/foo) (Id.Lit_Other ':') (/bar)} {(0)}) (C {(ancestor)} {(/foo)} {(/foo) (Id.Lit_Other ':') (/) (Id.Lit_Other ':') (/bar)} {(0)}) (C {(ancestor)} {(/foo)} {(/) (Id.Lit_Other ':') (/bar) (Id.Lit_Other ':') (/foo)} {(0)}) (C {(ancestor)} {(/foo/bar)} {(/)} {(0)}) (C {(ancestor)} {(/foo/bar)} {(/fo)} {(-1)}) (C {(ancestor)} {(/foo/bar)} {(/foo)} {(4)}) (C {(ancestor)} {(/foo/bar)} {(/foo/ba)} {(-1)}) (C {(ancestor)} {(/foo/bar)} {(/) (Id.Lit_Other ':') (/fo)} {(0)}) (C {(ancestor)} {(/foo/bar)} {(/foo) (Id.Lit_Other ':') (/foo/ba)} {(4)}) (C {(ancestor)} {(/foo/bar)} {(/bar)} {(-1)}) (C {(ancestor)} {(/foo/bar)} {(/fo)} {(-1)}) (C {(ancestor)} {(/foo/bar)} {(/foo) (Id.Lit_Other ':') (/bar)} {(4)}) (C {(ancestor)} {(/foo/bar)} {(/) (Id.Lit_Other ':') (/foo) (Id.Lit_Other ':') (/bar)} {(4)}) (C {(ancestor)} {(/foo/bar)} {(/foo) (Id.Lit_Other ':') (/) (Id.Lit_Other ':') (/bar)} {(4)}) (C {(ancestor)} {(/foo/bar)} {(/) (Id.Lit_Other ':') (/bar) (Id.Lit_Other ':') (/fo)} {(0)}) (C {(ancestor)} {(/foo/bar)} {(/) (Id.Lit_Other ':') (/bar)} {(0)}) (C {(ancestor)} {(/foo/bar)} {(/foo)} {(4)}) (C {(ancestor)} {(/foo/bar)} {(/foo) (Id.Lit_Other ':') (/bar)} {(4)}) (C {(ancestor)} {(/foo/bar)} {(/bar)} {(-1)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:strip_path_suffix span_id:1064))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1068) (Token id: Id.Lit_Chars val: '\ttest c:/msysgit = $(test-path-utils strip_path_suffix \\\n' span_id: 1069 ) (Token id:Id.Lit_Chars val:'\t\tc:/msysgit/libexec//git-core libexec/git-core)\n' span_id:1070) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'absolute path rejects the empty string' span_id:1077))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1081) (Token id: Id.Lit_Chars val: '\ttest_must_fail test-path-utils absolute_path ""\n' span_id: 1082 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'real path rejects the empty string' span_id:1089))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1093) (Token id: Id.Lit_Chars val: '\ttest_must_fail test-path-utils real_path ""\n' span_id: 1094 ) ) } ) (C {(test_expect_success)} {(POSIX)} {(SQ (Token id:Id.Lit_Chars val:'real path works on absolute paths 1' span_id:1103))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1107) (Token id:Id.Lit_Chars val:'\tnopath="hopefully-absent-path" &&\n' span_id:1108) (Token id:Id.Lit_Chars val:'\ttest "/" = "$(test-path-utils real_path "/")" &&\n' span_id:1109) (Token id: Id.Lit_Chars val: '\ttest "/$nopath" = "$(test-path-utils real_path "/$nopath")"\n' span_id: 1110 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'real path works on absolute paths 2' span_id:1117))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1121) (Token id:Id.Lit_Chars val:'\tnopath="hopefully-absent-path" &&\n' span_id:1122) (Token id: Id.Lit_Chars val: '\t# Find an existing top-level directory for the remaining tests:\n' span_id: 1123 ) (Token id:Id.Lit_Chars val:'\td=$(pwd -P | sed -e "s|^\\([^/]*/[^/]*\\)/.*|\\1|") &&\n' span_id:1124) (Token id: Id.Lit_Chars val: '\ttest "$d" = "$(test-path-utils real_path "$d")" &&\n' span_id: 1125 ) (Token id: Id.Lit_Chars val: '\ttest "$d/$nopath" = "$(test-path-utils real_path "$d/$nopath")"\n' span_id: 1126 ) ) } ) (C {(test_expect_success)} {(POSIX)} {(SQ (Token id:Id.Lit_Chars val:'real path removes extra leading slashes' span_id:1135))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1139) (Token id:Id.Lit_Chars val:'\tnopath="hopefully-absent-path" &&\n' span_id:1140) (Token id:Id.Lit_Chars val:'\ttest "/" = "$(test-path-utils real_path "///")" &&\n' span_id:1141) (Token id: Id.Lit_Chars val: '\ttest "/$nopath" = "$(test-path-utils real_path "///$nopath")" &&\n' span_id: 1142 ) (Token id: Id.Lit_Chars val: '\t# Find an existing top-level directory for the remaining tests:\n' span_id: 1143 ) (Token id:Id.Lit_Chars val:'\td=$(pwd -P | sed -e "s|^\\([^/]*/[^/]*\\)/.*|\\1|") &&\n' span_id:1144) (Token id: Id.Lit_Chars val: '\ttest "$d" = "$(test-path-utils real_path "//$d")" &&\n' span_id: 1145 ) (Token id: Id.Lit_Chars val: '\ttest "$d/$nopath" = "$(test-path-utils real_path "//$d/$nopath")"\n' span_id: 1146 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'real path removes other extra slashes' span_id:1153))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1157) (Token id:Id.Lit_Chars val:'\tnopath="hopefully-absent-path" &&\n' span_id:1158) (Token id: Id.Lit_Chars val: '\t# Find an existing top-level directory for the remaining tests:\n' span_id: 1159 ) (Token id:Id.Lit_Chars val:'\td=$(pwd -P | sed -e "s|^\\([^/]*/[^/]*\\)/.*|\\1|") &&\n' span_id:1160) (Token id: Id.Lit_Chars val: '\ttest "$d" = "$(test-path-utils real_path "$d///")" &&\n' span_id: 1161 ) (Token id: Id.Lit_Chars val: '\ttest "$d/$nopath" = "$(test-path-utils real_path "$d///$nopath")"\n' span_id: 1162 ) ) } ) (C {(test_expect_success)} {(SYMLINKS)} {(SQ (Token id:Id.Lit_Chars val:'real path works on symlinks' span_id:1171))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1175) (Token id:Id.Lit_Chars val:'\tmkdir first &&\n' span_id:1176) (Token id:Id.Lit_Chars val:'\tln -s ../.git first/.git &&\n' span_id:1177) (Token id:Id.Lit_Chars val:'\tmkdir second &&\n' span_id:1178) (Token id:Id.Lit_Chars val:'\tln -s ../first second/other &&\n' span_id:1179) (Token id:Id.Lit_Chars val:'\tmkdir third &&\n' span_id:1180) (Token id:Id.Lit_Chars val:'\tdir="$(cd .git; pwd -P)" &&\n' span_id:1181) (Token id:Id.Lit_Chars val:'\tdir2=third/../second/other/.git &&\n' span_id:1182) (Token id:Id.Lit_Chars val:'\ttest "$dir" = "$(test-path-utils real_path $dir2)" &&\n' span_id:1183) (Token id:Id.Lit_Chars val:'\tfile="$dir"/index &&\n' span_id:1184) (Token id: Id.Lit_Chars val: '\ttest "$file" = "$(test-path-utils real_path $dir2/index)" &&\n' span_id: 1185 ) (Token id:Id.Lit_Chars val:'\tbasename=blub &&\n' span_id:1186) (Token id: Id.Lit_Chars val: '\ttest "$dir/$basename" = "$(cd .git && test-path-utils real_path "$basename")" &&\n' span_id: 1187 ) (Token id:Id.Lit_Chars val:'\tln -s ../first/file .git/syml &&\n' span_id:1188) (Token id:Id.Lit_Chars val:'\tsym="$(cd first; pwd -P)"/file &&\n' span_id:1189) (Token id: Id.Lit_Chars val: '\ttest "$sym" = "$(test-path-utils real_path "$dir2/syml")"\n' span_id: 1190 ) ) } ) (C {(test_expect_success)} {(SYMLINKS)} { (SQ (Token id: Id.Lit_Chars val: 'prefix_path works with absolute paths to work tree symlinks' span_id: 1199 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1203) (Token id:Id.Lit_Chars val:'\tln -s target symlink &&\n' span_id:1204) (Token id: Id.Lit_Chars val: '\ttest "$(test-path-utils prefix_path prefix "$(pwd)/symlink")" = "symlink"\n' span_id: 1205 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'prefix_path works with only absolute path to work tree' span_id: 1212 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1216) (Token id:Id.Lit_Chars val:'\techo "" >expected &&\n' span_id:1217) (Token id:Id.Lit_Chars val:'\ttest-path-utils prefix_path prefix "$(pwd)" >actual &&\n' span_id:1218) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual\n' span_id:1219) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'prefix_path rejects absolute path to dir with same beginning as work tree' span_id: 1226 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1230) (Token id: Id.Lit_Chars val: '\ttest_must_fail test-path-utils prefix_path prefix "$(pwd)a"\n' span_id: 1231 ) ) } ) (C {(test_expect_success)} {(SYMLINKS)} { (SQ (Token id: Id.Lit_Chars val: 'prefix_path works with absolute path to a symlink to work tree having same beginning as work tree' span_id: 1240 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1244) (Token id:Id.Lit_Chars val:'\tgit init repo &&\n' span_id:1245) (Token id:Id.Lit_Chars val:'\tln -s repo repolink &&\n' span_id:1246) (Token id: Id.Lit_Chars val: '\ttest "a" = "$(cd repo && test-path-utils prefix_path prefix "$(pwd)/../repolink/a")"\n' span_id: 1247 ) ) } ) (C {(relative_path)} {(/foo/a/b/c/)} {(/foo/a/b/)} {(c/)}) (C {(relative_path)} {(/foo/a/b/c/)} {(/foo/a/b)} {(c/)}) (C {(relative_path)} {(/foo/a//b//c/)} {(///foo/a/b//)} {(c/)} {(POSIX)}) (C {(relative_path)} {(/foo/a/b)} {(/foo/a/b)} {(./)}) (C {(relative_path)} {(/foo/a/b/)} {(/foo/a/b)} {(./)}) (C {(relative_path)} {(/foo/a)} {(/foo/a/b)} {(../)}) (C {(relative_path)} {(/)} {(/foo/a/b/)} {(../../../)}) (C {(relative_path)} {(/foo/a/c)} {(/foo/a/b/)} {(../c)}) (C {(relative_path)} {(/foo/a/c)} {(/foo/a/b)} {(../c)}) (C {(relative_path)} {(/foo/x/y)} {(/foo/a/b/)} {(../../x/y)}) (C {(relative_path)} {(/foo/a/b)} {(DQ ('<empty>'))} {(/foo/a/b)}) (C {(relative_path)} {(/foo/a/b)} {(DQ ('<null>'))} {(/foo/a/b)}) (C {(relative_path)} {(foo/a/b/c/)} {(foo/a/b/)} {(c/)}) (C {(relative_path)} {(foo/a/b/c/)} {(foo/a/b)} {(c/)}) (C {(relative_path)} {(foo/a/b//c)} {(foo/a//b)} {(c)}) (C {(relative_path)} {(foo/a/b/)} {(foo/a/b/)} {(./)}) (C {(relative_path)} {(foo/a/b/)} {(foo/a/b)} {(./)}) (C {(relative_path)} {(foo/a)} {(foo/a/b)} {(../)}) (C {(relative_path)} {(foo/x/y)} {(foo/a/b)} {(../../x/y)}) (C {(relative_path)} {(foo/a/c)} {(foo/a/b)} {(../c)}) (C {(relative_path)} {(foo/a/b)} {(/foo/x/y)} {(foo/a/b)}) (C {(relative_path)} {(/foo/a/b)} {(foo/x/y)} {(/foo/a/b)}) (C {(relative_path)} {(d) (Id.Lit_Other ':') (/a/b)} {(D) (Id.Lit_Other ':') (/a/c)} {(../b)} {(MINGW)} ) (C {(relative_path)} {(C) (Id.Lit_Other ':') (/a/b)} {(D) (Id.Lit_Other ':') (/a/c)} {(C) (Id.Lit_Other ':') (/a/b)} {(MINGW)} ) (C {(relative_path)} {(foo/a/b)} {(DQ ('<empty>'))} {(foo/a/b)}) (C {(relative_path)} {(foo/a/b)} {(DQ ('<null>'))} {(foo/a/b)}) (C {(relative_path)} {(DQ ('<empty>'))} {(/foo/a/b)} {(./)}) (C {(relative_path)} {(DQ ('<empty>'))} {(DQ ('<empty>'))} {(./)}) (C {(relative_path)} {(DQ ('<empty>'))} {(DQ ('<null>'))} {(./)}) (C {(relative_path)} {(DQ ('<null>'))} {(DQ ('<empty>'))} {(./)}) (C {(relative_path)} {(DQ ('<null>'))} {(DQ ('<null>'))} {(./)}) (C {(relative_path)} {(DQ ('<null>'))} {(/foo/a/b)} {(./)}) (C {(test_git_path)} {(Id.Lit_VarLike 'A=') (B)} {(info/grafts)} {(.git/info/grafts)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_GRAFT_FILE=') (foo)} {(info/grafts)} {(foo)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_GRAFT_FILE=') (foo)} {(info/////grafts)} {(foo)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_INDEX_FILE=') (foo)} {(index)} {(foo)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_INDEX_FILE=') (foo)} {(index/foo)} {(.git/index/foo)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_INDEX_FILE=') (foo)} {(index2)} {(.git/index2)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'setup fake objects directory foo' span_id:1609))} {(SQ (Token id:Id.Lit_Chars val:'mkdir foo' span_id:1613))} ) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_OBJECT_DIRECTORY=') (foo)} {(objects)} {(foo)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_OBJECT_DIRECTORY=') (foo)} {(objects/foo)} {(foo/foo)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_OBJECT_DIRECTORY=') (foo)} {(objects2)} {(.git/objects2)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'setup common repository' span_id:1646))} {(SQ (Token id:Id.Lit_Chars val:'git --git-dir=bar init' span_id:1650))} ) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(index)} {(.git/index)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(HEAD)} {(.git/HEAD)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(logs/HEAD)} {(.git/logs/HEAD)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(logs/refs/bisect/foo)} {(.git/logs/refs/bisect/foo)} ) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(logs/refs/bisec/foo)} {(bar/logs/refs/bisec/foo)} ) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(logs/refs/bisec)} {(bar/logs/refs/bisec)} ) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(logs/refs/bisectfoo)} {(bar/logs/refs/bisectfoo)} ) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(objects)} {(bar/objects)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(objects/bar)} {(bar/objects/bar)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(info/exclude)} {(bar/info/exclude)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(info/grafts)} {(bar/info/grafts)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(info/sparse-checkout)} {(.git/info/sparse-checkout)} ) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(info//sparse-checkout)} {(.git/info//sparse-checkout)} ) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(remotes/bar)} {(bar/remotes/bar)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(branches/bar)} {(bar/branches/bar)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(logs/refs/heads/master)} {(bar/logs/refs/heads/master)} ) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(refs/heads/master)} {(bar/refs/heads/master)} ) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(refs/bisect/foo)} {(.git/refs/bisect/foo)} ) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(hooks/me)} {(bar/hooks/me)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(config)} {(bar/config)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(packed-refs)} {(bar/packed-refs)}) (C {(test_git_path)} {(Id.Lit_VarLike 'GIT_COMMON_DIR=') (bar)} {(shallow)} {(bar/shallow)}) (C {(test_submodule_relative_url)} {(DQ (../))} {(DQ (../foo))} {(DQ (../submodule))} {(DQ (../../submodule))} ) (C {(test_submodule_relative_url)} {(DQ (../))} {(DQ (../foo/bar))} {(DQ (../submodule))} {(DQ (../../foo/submodule))} ) (C {(test_submodule_relative_url)} {(DQ (../))} {(DQ (../foo/submodule))} {(DQ (../submodule))} {(DQ (../../foo/submodule))} ) (C {(test_submodule_relative_url)} {(DQ (../))} {(DQ (./foo))} {(DQ (../submodule))} {(DQ (../submodule))} ) (C {(test_submodule_relative_url)} {(DQ (../))} {(DQ (./foo/bar))} {(DQ (../submodule))} {(DQ (../foo/submodule))} ) (C {(test_submodule_relative_url)} {(DQ (../../../))} {(DQ (../foo/bar))} {(DQ (../sub/a/b/c))} {(DQ (../../../../foo/sub/a/b/c))} ) (C {(test_submodule_relative_url)} {(DQ (../))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1977) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/addtest) ) } {(DQ (../repo))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1988) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/repo) ) } ) (C {(test_submodule_relative_url)} {(DQ (../))} {(DQ (foo/bar))} {(DQ (../submodule))} {(DQ (../foo/submodule))} ) (C {(test_submodule_relative_url)} {(DQ (../))} {(DQ (foo))} {(DQ (../submodule))} {(DQ (../submodule))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ (../foo/bar))} {(DQ (../sub/a/b/c))} {(DQ (../foo/sub/a/b/c))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ (../foo/bar))} {(DQ (../sub/a/b/c/))} {(DQ (../foo/sub/a/b/c))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ (../foo/bar/))} {(DQ (../sub/a/b/c))} {(DQ (../foo/sub/a/b/c))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ (../foo/bar))} {(DQ (../submodule))} {(DQ (../foo/submodule))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ (../foo/submodule))} {(DQ (../submodule))} {(DQ (../foo/submodule))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ (../foo))} {(DQ (../submodule))} {(DQ (../submodule))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ (./foo/bar))} {(DQ (../submodule))} {(DQ (foo/submodule))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ (./foo))} {(DQ (../submodule))} {(DQ (submodule))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ ('//somewhere else/repo'))} {(DQ (../subrepo))} {(DQ ('//somewhere else/subrepo'))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2200) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/subsuper_update_r) ) } {(DQ (../subsubsuper_update_r))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2211) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/subsubsuper_update_r) ) } ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2224) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/super_update_r2) ) } {(DQ (../subsuper_update_r))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2235) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/subsuper_update_r) ) } ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2248) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/.) ) } {(DQ (../.))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2259) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/.) ) } ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2272) command_list: (command.CommandList children:[(C {(pwd)})]) ) ) } {(DQ (./.))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2282) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/.) ) } ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2295) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/addtest) ) } {(DQ (../repo))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2306) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/repo) ) } ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2319) command_list: (command.CommandList children:[(C {(pwd)})]) ) ) } {(DQ ('./\xc3\xa5 \xc3\xa4\xc3\xb6'))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2329) command_list: (command.CommandList children:[(C {(pwd)})]) ) ('/\xc3\xa5 \xc3\xa4\xc3\xb6') ) } ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2342) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/.) ) } {(DQ (../submodule))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2353) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/submodule) ) } ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2366) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/submodule) ) } {(DQ (../submodule))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2377) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/submodule) ) } ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2390) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/home2/../remote) ) } {(DQ (../bundle1))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2401) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/home2/../bundle1) ) } ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2414) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/submodule_update_repo) ) } {(DQ (./.))} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2425) command_list: (command.CommandList children:[(C {(pwd)})]) ) (/submodule_update_repo/.) ) } ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ ('file:///tmp/repo'))} {(DQ (../subrepo))} {(DQ ('file:///tmp/subrepo'))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ (foo/bar))} {(DQ (../submodule))} {(DQ (foo/submodule))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ (foo))} {(DQ (../submodule))} {(DQ (submodule))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ ('helper:://hostname/repo'))} {(DQ (../subrepo))} {(DQ ('helper:://hostname/subrepo'))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ ('ssh://hostname/repo'))} {(DQ (../subrepo))} {(DQ ('ssh://hostname/subrepo'))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ ('ssh://hostname:22/repo'))} {(DQ (../subrepo))} {(DQ ('ssh://hostname:22/subrepo'))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ ('user@host:path/to/repo'))} {(DQ (../subrepo))} {(DQ ('user@host:path/to/subrepo'))} ) (C {(test_submodule_relative_url)} {(DQ ('(null)'))} {(DQ ('user@host:repo'))} {(DQ (../subrepo))} {(DQ ('user@host:subrepo'))} ) (C {(test_done)}) ] )