(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'git svn basic tests'>)} spids: [13] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:GIT_SVN_LC_ALL) op: assign_op.Equal rhs: { (braced_var_sub token: <Id.VSub_Name LC_ALL> suffix_op: (suffix_op.Unary tok: <Id.VTest_ColonHyphen ':-'> arg_word: {($ Id.VSub_DollarName '$LANG')} ) ) } spids: [18] ) ] ) (C {<.>} {<'./lib-git-svn.sh'>}) (command.Case to_match: {(DQ ($ Id.VSub_DollarName '$GIT_SVN_LC_ALL'))} arms: [ (case_arm pat_list: [{<Id.Lit_Star '*'> <.UTF-8>}] action: [(C {<test_set_prereq>} {<UTF8>})] spids: [39 41 49 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (C {<say>} { (DQ <'# UTF-8 locale not set, some tests skipped ('> ($ Id.VSub_DollarName '$GIT_SVN_LC_ALL') <')'> ) } ) ] spids: [51 52 64 -1] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:deepdir) op: assign_op.Equal rhs: {<nothing-above>} spids: [69] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ceiling) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$PWD')} spids: [72] ) ] ) (C {<test_expect_success>} {(SQ <'git svn --version works anywhere'>)} { (SQ <'\n'> <'\tmkdir -p "$deepdir" && (\n'> <'\t\tGIT_CEILING_DIRECTORIES="$ceiling" &&\n'> <'\t\texport GIT_CEILING_DIRECTORIES &&\n'> <'\t\tcd "$deepdir" &&\n'> <'\t\tgit svn --version\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'git svn help works anywhere'>)} { (SQ <'\n'> <'\tmkdir -p "$deepdir" && (\n'> <'\t\tGIT_CEILING_DIRECTORIES="$ceiling" &&\n'> <'\t\texport GIT_CEILING_DIRECTORIES &&\n'> <'\t\tcd "$deepdir" &&\n'> <'\t\tgit svn help\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'initialize git svn'>)} { (SQ <'\n'> <'\tmkdir import &&\n'> <'\t(\n'> <'\t\tcd import &&\n'> <'\t\techo foo >foo &&\n'> <'\t\tln -s foo foo.link\n'> <'\t\tmkdir -p dir/a/b/c/d/e &&\n'> <'\t\techo "deep dir" >dir/a/b/c/d/e/file &&\n'> <'\t\tmkdir bar &&\n'> <'\t\techo "zzz" >bar/zzz &&\n'> <'\t\techo "#!/bin/sh" >exec.sh &&\n'> <'\t\tchmod +x exec.sh &&\n'> <'\t\tsvn_cmd import -m "import for git svn" . "$svnrepo" >/dev/null\n'> <'\t) &&\n'> <'\trm -rf import &&\n'> <'\tgit svn init "$svnrepo"'> ) } ) (C {<test_expect_success>} {(SQ <'import an SVN revision into git'>)} {(SQ <'git svn fetch'>)}) (C {<test_expect_success>} {(DQ <'checkout from svn'>)} {(SQ <'svn co "$svnrepo" "$SVN_TREE"'>)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(SQ <'try a deep --rmdir with a commit'>)} spids: [164] ) ] ) (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$name'))} { (SQ <'\n'> <'\tgit checkout -f -b mybranch remotes/git-svn &&\n'> <'\tmv dir/a/b/c/d/e/file dir/file &&\n'> <'\tcp dir/file file &&\n'> <'\tgit update-index --add --remove dir/a/b/c/d/e/file dir/file file &&\n'> <'\tgit commit -m "$name" &&\n'> <'\tgit svn set-tree --find-copies-harder --rmdir \\\n'> <'\t\tremotes/git-svn..mybranch &&\n'> <'\tsvn_cmd up "$SVN_TREE" &&\n'> <'\ttest -d "$SVN_TREE"/dir && test ! -d "$SVN_TREE"/dir/a'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(SQ <'detect node change from file to directory #1'>)} spids: [190] ) ] ) (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$name'))} { (DQ <'\n'> <'\tmkdir dir/new_file &&\n'> <'\tmv dir/file dir/new_file/file &&\n'> <'\tmv dir/new_file dir/file &&\n'> <'\tgit update-index --remove dir/file &&\n'> <'\tgit update-index --add dir/file/file &&\n'> <'\tgit commit -m \''> ($ Id.VSub_DollarName '$name') <'\' &&\n'> <'\ttest_must_fail git svn set-tree --find-copies-harder --rmdir '> <'\t\tremotes/git-svn..mybranch\n'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(SQ <'detect node change from directory to file #1'>)} spids: [218] ) ] ) (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$name'))} { (SQ <'\n'> <'\trm -rf dir "$GIT_DIR"/index &&\n'> <'\tgit checkout -f -b mybranch2 remotes/git-svn &&\n'> <'\tmv bar/zzz zzz &&\n'> <'\trm -rf bar &&\n'> <'\tmv zzz bar &&\n'> <'\tgit update-index --remove -- bar/zzz &&\n'> <'\tgit update-index --add -- bar &&\n'> <'\tgit commit -m "$name" &&\n'> <'\ttest_must_fail git svn set-tree --find-copies-harder --rmdir \\\n'> <'\t\tremotes/git-svn..mybranch2\n'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(SQ <'detect node change from file to directory #2'>)} spids: [245] ) ] ) (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$name'))} { (SQ <'\n'> <'\trm -f "$GIT_DIR"/index &&\n'> <'\tgit checkout -f -b mybranch3 remotes/git-svn &&\n'> <'\trm bar/zzz &&\n'> <'\tgit update-index --remove bar/zzz &&\n'> <'\tmkdir bar/zzz &&\n'> <'\techo yyy > bar/zzz/yyy &&\n'> <'\tgit update-index --add bar/zzz/yyy &&\n'> <'\tgit commit -m "$name" &&\n'> <'\tgit svn set-tree --find-copies-harder --rmdir \\\n'> <'\t\tremotes/git-svn..mybranch3 &&\n'> <'\tsvn_cmd up "$SVN_TREE" &&\n'> <'\ttest -d "$SVN_TREE"/bar/zzz &&\n'> <'\ttest -e "$SVN_TREE"/bar/zzz/yyy\n'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(SQ <'detect node change from directory to file #2'>)} spids: [274] ) ] ) (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$name'))} { (SQ <'\n'> <'\trm -f "$GIT_DIR"/index &&\n'> <'\tgit checkout -f -b mybranch4 remotes/git-svn &&\n'> <'\trm -rf dir &&\n'> <'\tgit update-index --remove -- dir/file &&\n'> <'\ttouch dir &&\n'> <'\techo asdf > dir &&\n'> <'\tgit update-index --add -- dir &&\n'> <'\tgit commit -m "$name" &&\n'> <'\ttest_must_fail git svn set-tree --find-copies-harder --rmdir \\\n'> <'\t\tremotes/git-svn..mybranch4\n'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(SQ <'remove executable bit from a file'>)} spids: [301] ) ] ) (C {<test_expect_success>} {<POSIXPERM>} {(DQ ($ Id.VSub_DollarName '$name'))} { (SQ <'\n'> <'\trm -f "$GIT_DIR"/index &&\n'> <'\tgit checkout -f -b mybranch5 remotes/git-svn &&\n'> <'\tchmod -x exec.sh &&\n'> <'\tgit update-index exec.sh &&\n'> <'\tgit commit -m "$name" &&\n'> <'\tgit svn set-tree --find-copies-harder --rmdir \\\n'> <'\t\tremotes/git-svn..mybranch5 &&\n'> <'\tsvn_cmd up "$SVN_TREE" &&\n'> <'\ttest ! -x "$SVN_TREE"/exec.sh'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(SQ <'add executable bit back file'>)} spids: [329] ) ] ) (C {<test_expect_success>} {<POSIXPERM>} {(DQ ($ Id.VSub_DollarName '$name'))} { (SQ <'\n'> <'\tchmod +x exec.sh &&\n'> <'\tgit update-index exec.sh &&\n'> <'\tgit commit -m "$name" &&\n'> <'\tgit svn set-tree --find-copies-harder --rmdir \\\n'> <'\t\tremotes/git-svn..mybranch5 &&\n'> <'\tsvn_cmd up "$SVN_TREE" &&\n'> <'\ttest -x "$SVN_TREE"/exec.sh'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(SQ <'executable file becomes a symlink to file'>)} spids: [355] ) ] ) (C {<test_expect_success>} {<SYMLINKS>} {(DQ ($ Id.VSub_DollarName '$name'))} { (SQ <'\n'> <'\trm exec.sh &&\n'> <'\tln -s file exec.sh &&\n'> <'\tgit update-index exec.sh &&\n'> <'\tgit commit -m "$name" &&\n'> <'\tgit svn set-tree --find-copies-harder --rmdir \\\n'> <'\t\tremotes/git-svn..mybranch5 &&\n'> <'\tsvn_cmd up "$SVN_TREE" &&\n'> <'\ttest -h "$SVN_TREE"/exec.sh'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(SQ <'new symlink is added to a file that was also just made executable'>)} spids: [381] ) ] ) (C {<test_expect_success>} {<POSIXPERM> <Id.Lit_Comma ','> <SYMLINKS>} {(DQ ($ Id.VSub_DollarName '$name'))} { (SQ <'\n'> <'\tchmod +x file &&\n'> <'\tln -s file exec-2.sh &&\n'> <'\tgit update-index --add file exec-2.sh &&\n'> <'\tgit commit -m "$name" &&\n'> <'\tgit svn set-tree --find-copies-harder --rmdir \\\n'> <'\t\tremotes/git-svn..mybranch5 &&\n'> <'\tsvn_cmd up "$SVN_TREE" &&\n'> <'\ttest -x "$SVN_TREE"/file &&\n'> <'\ttest -h "$SVN_TREE"/exec-2.sh'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(SQ <'modify a symlink to become a file'>)} spids: [411] ) ] ) (C {<test_expect_success>} {<POSIXPERM> <Id.Lit_Comma ','> <SYMLINKS>} {(DQ ($ Id.VSub_DollarName '$name'))} { (SQ <'\n'> <'\techo git help >help &&\n'> <'\trm exec-2.sh &&\n'> <'\tcp help exec-2.sh &&\n'> <'\tgit update-index exec-2.sh &&\n'> <'\tgit commit -m "$name" &&\n'> <'\tgit svn set-tree --find-copies-harder --rmdir \\\n'> <'\t\tremotes/git-svn..mybranch5 &&\n'> <'\tsvn_cmd up "$SVN_TREE" &&\n'> <'\ttest -f "$SVN_TREE"/exec-2.sh &&\n'> <'\ttest ! -h "$SVN_TREE"/exec-2.sh &&\n'> <'\ttest_cmp help "$SVN_TREE"/exec-2.sh'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(DQ <'commit with UTF-8 message: locale: '> ($ Id.VSub_DollarName '$GIT_SVN_LC_ALL'))} spids: [442] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:LC_ALL) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$GIT_SVN_LC_ALL'))} spids: [448] ) ] ) (C {<export>} {<LC_ALL>}) (C {<test_expect_success>} {<UTF8> <Id.Lit_Comma ','> <POSIXPERM> <Id.Lit_Comma ','> <SYMLINKS>} {(DQ ($ Id.VSub_DollarName '$name'))} { (DQ <'\n'> <'\techo \'# hello\' >> exec-2.sh &&\n'> <'\tgit update-index exec-2.sh &&\n'> <'\tgit commit -m \'éï∏\' &&\n'> <'\tgit svn set-tree HEAD'> ) } ) (C {<unset>} {<LC_ALL>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(SQ <'test fetch functionality (svn => git) with alternate GIT_SVN_ID'>)} spids: [485] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:GIT_SVN_ID) op: assign_op.Equal rhs: {<alt>} spids: [490] ) ] ) (C {<export>} {<GIT_SVN_ID>}) (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$name'))} { (SQ <'git svn init "$svnrepo" && git svn fetch &&\n'> <' git rev-list --pretty=raw remotes/git-svn | grep ^tree | uniq > a &&\n'> <' git rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&\n'> <' test_cmp a b'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(SQ <'check imported tree checksums expected tree checksums'>)} spids: [513] ) ] ) (C {<rm>} {<-f>} {<expected>}) (command.If arms: [ (if_arm cond: (condition.Shell commands:[(C {<test_have_prereq>} {<UTF8>})]) action: [ (command.Simple words: [{<echo>} {<tree>} {<dc68b14b733e4ec85b04ab6f712340edc5dc936e>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>})] do_fork: T ) ] spids: [524 530] ) ] ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<expected>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'>) <OF>} here_end_span_id: 563 stdin_parts: [ <'tree c3322890dcf74901f32d216f05c5044f670ce632\n'> <'tree d3ccd5035feafd17b030c5732e7808cc49122853\n'> <'tree d03e1630363d4881e68929d532746b20b0986b83\n'> <'tree 149d63cd5878155c846e8c55d7d8487de283f89e\n'> <'tree 312b76e4f64ce14893aeac8591eb3960b065e247\n'> <'tree 149d63cd5878155c846e8c55d7d8487de283f89e\n'> <'tree d667270a1f7b109f5eb3aaea21ede14b56bfdd6e\n'> <'tree 8f51f74cf0163afc9ad68a4b1537288c4558b5a4\n'> ] ) ) ] do_fork: T ) (C {<test_expect_success>} {<POSIXPERM> <Id.Lit_Comma ','> <SYMLINKS>} {(DQ ($ Id.VSub_DollarName '$name'))} {(DQ <'test_cmp a expected'>)} ) (C {<test_expect_success>} {(SQ <'exit if remote refs are ambigious'>)} { (SQ <'\n'> <' git config --add svn-remote.svn.fetch \\\n'> <'\t\tbar:refs/remotes/git-svn &&\n'> <'\ttest_must_fail git svn migrate\n'> ) } ) (C {<test_expect_success>} {(SQ <'exit if init-ing a would clobber a URL'>)} { (SQ <'\n'> <' svnadmin create "${PWD}/svnrepo2" &&\n'> <' svn mkdir -m "mkdir bar" "${svnrepo}2/bar" &&\n'> <' git config --unset svn-remote.svn.fetch \\\n'> <'\t\t"^bar:refs/remotes/git-svn$" &&\n'> <'\ttest_must_fail git svn init "${svnrepo}2/bar"\n'> <' '> ) } ) (C {<test_expect_success>} {(SQ <'init allows us to connect to another directory in the same repo'>)} { (SQ <'\n'> <' git svn init --minimize-url -i bar "$svnrepo/bar" &&\n'> <' git config --get svn-remote.svn.fetch \\\n'> <' "^bar:refs/remotes/bar$" &&\n'> <' git config --get svn-remote.svn.fetch \\\n'> <'\t\t\t "^:refs/remotes/git-svn$"\n'> <' '> ) } ) (C {<test_expect_success>} {(SQ <'dcommit $rev does not clobber current branch'>)} { (SQ <'\n'> <'\tgit svn fetch -i bar &&\n'> <'\tgit checkout -b my-bar refs/remotes/bar &&\n'> <'\techo 1 > foo &&\n'> <'\tgit add foo &&\n'> <'\tgit commit -m "change 1" &&\n'> <'\techo 2 > foo &&\n'> <'\tgit add foo &&\n'> <'\tgit commit -m "change 2" &&\n'> <'\told_head=$(git rev-parse HEAD) &&\n'> <'\tgit svn dcommit -i bar HEAD^ &&\n'> <'\ttest $old_head = $(git rev-parse HEAD) &&\n'> <'\ttest refs/heads/my-bar = $(git symbolic-ref HEAD) &&\n'> <'\tgit log refs/remotes/bar | grep "change 1" &&\n'> <'\t! git log refs/remotes/bar | grep "change 2" &&\n'> <'\tgit checkout master &&\n'> <'\tgit branch -D my-bar\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'able to dcommit to a subdirectory'>)} { (SQ <'\n'> <'\tgit svn fetch -i bar &&\n'> <'\tgit checkout -b my-bar refs/remotes/bar &&\n'> <'\techo abc > d &&\n'> <'\tgit update-index --add d &&\n'> <'\tgit commit -m "/bar/d should be in the log" &&\n'> <'\tgit svn dcommit -i bar &&\n'> <'\ttest -z "$(git diff refs/heads/my-bar refs/remotes/bar)" &&\n'> <'\tmkdir newdir &&\n'> <'\techo new > newdir/dir &&\n'> <'\tgit update-index --add newdir/dir &&\n'> <'\tgit commit -m "add a new directory" &&\n'> <'\tgit svn dcommit -i bar &&\n'> <'\ttest -z "$(git diff refs/heads/my-bar refs/remotes/bar)" &&\n'> <'\techo foo >> newdir/dir &&\n'> <'\tgit update-index newdir/dir &&\n'> <'\tgit commit -m "modify a file in new directory" &&\n'> <'\tgit svn dcommit -i bar &&\n'> <'\ttest -z "$(git diff refs/heads/my-bar refs/remotes/bar)"\n'> ) } ) (C {<test_expect_success>} {(SQ <'dcommit should not fail with a touched file'>)} { (SQ <'\n'> <'\ttest_commit "commit-new-file-foo2" foo2 &&\n'> <'\ttest-chmtime =-60 foo &&\n'> <'\tgit svn dcommit\n'> ) } ) (C {<test_expect_success>} {(SQ <'rebase should not fail with a touched file'>)} {(SQ <'\n'> <'\ttest-chmtime =-60 foo &&\n'> <'\tgit svn rebase\n'>)} ) (C {<test_expect_success>} {(SQ <'able to set-tree to a subdirectory'>)} { (SQ <'\n'> <'\techo cba > d &&\n'> <'\tgit update-index d &&\n'> <'\tgit commit -m "update /bar/d" &&\n'> <'\tgit svn set-tree -i bar HEAD &&\n'> <'\ttest -z "$(git diff refs/heads/my-bar refs/remotes/bar)"\n'> ) } ) (C {<test_expect_success>} {(SQ <'git-svn works in a bare repository'>)} { (SQ <'\n'> <'\tmkdir bare-repo &&\n'> <'\t( cd bare-repo &&\n'> <'\tgit init --bare &&\n'> <'\tGIT_DIR=. git svn init "$svnrepo" &&\n'> <'\tgit svn fetch ) &&\n'> <'\trm -rf bare-repo\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'git-svn works in in a repository with a gitdir: link'>)} { (SQ <'\n'> <'\tmkdir worktree gitdir &&\n'> <'\t( cd worktree &&\n'> <'\tgit svn init "$svnrepo" &&\n'> <'\tgit init --separate-git-dir ../gitdir &&\n'> <'\tgit svn fetch ) &&\n'> <'\trm -rf worktree gitdir\n'> <'\t'> ) } ) (C {<test_done>}) ] )