@matheusbsbs / matheus-bagliano / commits / f69e836fab
Fork 0

Fix tests breaking when checkout path contains shell metacharacters

This fixes the remainder of the issues where the test script itself is at fault for failing when the git checkout path contains whitespace or other shell metacharacters. The majority of git svn tests used the idiom test_expect_success "title" "test script using $svnrepo" These were changed to have the test script in single-quotes: test_expect_success "title" 'test script using "$svnrepo"' which unfortunately makes the patch appear larger than it really is. One consequence of this change is that in the verbose test output the value of $svnrepo (and in some cases other variables, too) is no longer expanded, i.e. previously we saw * expecting success: test script using /path/to/git/t/trash/svnrepo but now it is: * expecting success: test script using "$svnrepo" Signed-off-by: Bryan Donlan <bdonlan@fushizen.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Bryan Donlan committed May 4, 2008 at 01:37 UTC f69e836fab2b634281d92a0d304de4d768e479cc
39 files changed +475 -469
t/t0000-basic.sh
+2 -2
@@ -305,10 +305,10 @@ test_expect_success 'absolute path works as expected' '
305 file="$dir"/index &&
306 test "$file" = "$(test-absolute-path $dir2/index)" &&
307 basename=blub &&
308 - test "$dir/$basename" = $(cd .git && test-absolute-path $basename) &&
308 + test "$dir/$basename" = "$(cd .git && test-absolute-path "$basename")" &&
309 ln -s ../first/file .git/syml &&
310 sym="$(cd first; pwd -P)"/file &&
311 - test "$sym" = "$(test-absolute-path $dir2/syml)"
311 + test "$sym" = "$(test-absolute-path "$dir2/syml")"
312 '
313
314 test_expect_success 'very long name in the index handled sanely' '
t/t1020-subdirectory.sh
+11 -11
@@ -21,7 +21,7 @@ LF='
21 '
22
23 test_expect_success 'update-index and ls-files' '
24 - cd $HERE &&
24 + cd "$HERE" &&
25 git update-index --add one &&
26 case "`git ls-files`" in
27 one) echo ok one ;;
@@ -41,7 +41,7 @@ test_expect_success 'update-index and ls-files' '
41 '
42
43 test_expect_success 'cat-file' '
44 - cd $HERE &&
44 + cd "$HERE" &&
45 two=`git ls-files -s dir/two` &&
46 two=`expr "$two" : "[0-7]* \\([0-9a-f]*\\)"` &&
47 echo "$two" &&
@@ -54,7 +54,7 @@ test_expect_success 'cat-file' '
54 rm -f actual dir/actual
55
56 test_expect_success 'diff-files' '
57 - cd $HERE &&
57 + cd "$HERE" &&
58 echo a >>one &&
59 echo d >>dir/two &&
60 case "`git diff-files --name-only`" in
@@ -74,7 +74,7 @@ test_expect_success 'diff-files' '
74 '
75
76 test_expect_success 'write-tree' '
77 - cd $HERE &&
77 + cd "$HERE" &&
78 top=`git write-tree` &&
79 echo $top &&
80 cd dir &&
@@ -84,7 +84,7 @@ test_expect_success 'write-tree' '
84 '
85
86 test_expect_success 'checkout-index' '
87 - cd $HERE &&
87 + cd "$HERE" &&
88 git checkout-index -f -u one &&
89 cmp one original.one &&
90 cd dir &&
@@ -93,7 +93,7 @@ test_expect_success 'checkout-index' '
93 '
94
95 test_expect_success 'read-tree' '
96 - cd $HERE &&
96 + cd "$HERE" &&
97 rm -f one dir/two &&
98 tree=`git write-tree` &&
99 git read-tree --reset -u "$tree" &&
@@ -107,27 +107,27 @@ test_expect_success 'read-tree' '
107 '
108
109 test_expect_success 'no file/rev ambiguity check inside .git' '
110 - cd $HERE &&
110 + cd "$HERE" &&
111 git commit -a -m 1 &&
112 - cd $HERE/.git &&
112 + cd "$HERE"/.git &&
113 git show -s HEAD
114 '
115
116 test_expect_success 'no file/rev ambiguity check inside a bare repo' '
117 - cd $HERE &&
117 + cd "$HERE" &&
118 git clone -s --bare .git foo.git &&
119 cd foo.git && GIT_DIR=. git show -s HEAD
120 '
121
122 # This still does not work as it should...
123 : test_expect_success 'no file/rev ambiguity check inside a bare repo' '
124 - cd $HERE &&
124 + cd "$HERE" &&
125 git clone -s --bare .git foo.git &&
126 cd foo.git && git show -s HEAD
127 '
128
129 test_expect_success 'detection should not be fooled by a symlink' '
130 - cd $HERE &&
130 + cd "$HERE" &&
131 rm -fr foo.git &&
132 git clone -s .git another &&
133 ln -s another yetanother &&
t/t3050-subprojects-fetch.sh
+1 -1
@@ -20,7 +20,7 @@ test_expect_success setup '
20 '
21
22 test_expect_success clone '
23 - git clone file://`pwd`/.git cloned &&
23 + git clone "file://$(pwd)/.git" cloned &&
24 (git rev-parse HEAD; git ls-files -s) >expected &&
25 (
26 cd cloned &&
t/t3404-rebase-interactive.sh
+1 -2
@@ -91,9 +91,8 @@ for line in $FAKE_LINES; do
91 done
92 EOF
93
94 +test_set_editor "$(pwd)/fake-editor.sh"
95 chmod a+x fake-editor.sh
95 -VISUAL="$(pwd)/fake-editor.sh"
96 -export VISUAL
96
97 test_expect_success 'no changes are a nop' '
98 git rebase -i F &&
t/t5500-fetch-pack.sh
+1 -1
@@ -129,7 +129,7 @@ pull_to_client 2nd "B" $((64*3))
129
130 pull_to_client 3rd "A" $((1*3)) # old fails
131
132 -test_expect_success "clone shallow" "git-clone --depth 2 file://`pwd`/. shallow"
132 +test_expect_success "clone shallow" 'git-clone --depth 2 "file://$(pwd)/." shallow'
133
134 (cd shallow; git count-objects -v) > count.shallow
135
t/t5512-ls-remote.sh
+1 -1
@@ -17,7 +17,7 @@ test_expect_success setup '
17 git show-ref -d | sed -e "s/ / /"
18 ) >expected.all &&
19
20 - git remote add self $(pwd)/.git
20 + git remote add self "$(pwd)/.git"
21
22 '
23
t/t5516-fetch-push.sh
+3 -3
@@ -105,7 +105,7 @@ test_expect_success 'fetch with insteadOf' '
105 (
106 TRASH=$(pwd)/ &&
107 cd testrepo &&
108 - git config url.$TRASH.insteadOf trash/
108 + git config "url.$TRASH.insteadOf" trash/ &&
109 git config remote.up.url trash/. &&
110 git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
111 git fetch up &&
@@ -145,8 +145,8 @@ test_expect_success 'push with wildcard' '
145
146 test_expect_success 'push with insteadOf' '
147 mk_empty &&
148 - TRASH=$(pwd)/ &&
149 - git config url.$TRASH.insteadOf trash/ &&
148 + TRASH="$(pwd)/" &&
149 + git config "url./$TRASH/.insteadOf" trash/ &&
150 git push trash/testrepo refs/heads/master:refs/remotes/origin/master &&
151 (
152 cd testrepo &&
t/t5700-clone-reference.sh
+1 -1
@@ -51,7 +51,7 @@ diff expected current'
51 cd "$base_dir"
52
53 test_expect_success 'cloning with reference (no -l -s)' \
54 -'git clone --reference B file://`pwd`/A D'
54 +'git clone --reference B "file://$(pwd)/A" D'
55
56 cd "$base_dir"
57
t/t5710-info-alternate.sh
+2 -2
@@ -81,9 +81,9 @@ test_valid_repo'
81 cd "$base_dir"
82
83 test_expect_success 'breaking of loops' \
84 -"echo '$base_dir/B/.git/objects' >> '$base_dir'/A/.git/objects/info/alternates&&
84 +'echo "$base_dir"/B/.git/objects >> "$base_dir"/A/.git/objects/info/alternates&&
85 cd C &&
86 -test_valid_repo"
86 +test_valid_repo'
87
88 cd "$base_dir"
89
t/t7003-filter-branch.sh
+1 -1
@@ -125,7 +125,7 @@ test_expect_success 'use index-filter to move into a subdirectory' '
125 "git ls-files -s | sed \"s-\\t-&newsubdir/-\" |
126 GIT_INDEX_FILE=\$GIT_INDEX_FILE.new \
127 git update-index --index-info &&
128 - mv \$GIT_INDEX_FILE.new \$GIT_INDEX_FILE" directorymoved &&
128 + mv \"\$GIT_INDEX_FILE.new\" \"\$GIT_INDEX_FILE\"" directorymoved &&
129 test -z "$(git diff HEAD directorymoved:newsubdir)"'
130
131 test_expect_success 'stops when msg filter fails' '
t/t7010-setup.sh
+1 -1
@@ -122,7 +122,7 @@ test_expect_success 'commit using absolute path names' '
122
123 test_expect_success 'log using absolute path names' '
124 echo bb >>a/b/c/d &&
125 - git commit -m "bb" $(pwd)/a/b/c/d &&
125 + git commit -m "bb" "$(pwd)/a/b/c/d" &&
126
127 git log a/b/c/d >f1.txt &&
128 git log "$(pwd)/a/b/c/d" >f2.txt &&
t/t7300-clean.sh
+1 -1
@@ -112,7 +112,7 @@ test_expect_success 'git-clean with absolute path' '
112 touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
113 would_clean=$(
114 cd docs &&
115 - git clean -n $(pwd)/../src |
115 + git clean -n "$(pwd)/../src" |
116 sed -n -e "s|^Would remove ||p"
117 ) &&
118 test "$would_clean" = ../src/part3.c || {
t/t7501-commit.sh
+4 -4
@@ -79,8 +79,8 @@ test_expect_success \
79
80 cat >editor <<\EOF
81 #!/bin/sh
82 -sed -e "s/a file/an amend commit/g" < $1 > $1-
83 -mv $1- $1
82 +sed -e "s/a file/an amend commit/g" < "$1" > "$1-"
83 +mv "$1-" "$1"
84 EOF
85 chmod 755 editor
86
@@ -99,8 +99,8 @@ test_expect_success \
99
100 cat >editor <<\EOF
101 #!/bin/sh
102 -sed -e "s/amend/older/g" < $1 > $1-
103 -mv $1- $1
102 +sed -e "s/amend/older/g" < "$1" > "$1-"
103 +mv "$1-" "$1"
104 EOF
105 chmod 755 editor
106
t/t7504-commit-msg-hook.sh
+13 -10
@@ -19,6 +19,9 @@ cp FAKE_MSG "$1"
19 exit 0
20 EOF
21 chmod +x fake-editor
22 +
23 +## Not using test_set_editor here so we can easily ensure the editor variable
24 +## is only set for the editor tests
25 FAKE_EDITOR="$(pwd)/fake-editor"
26 export FAKE_EDITOR
27
@@ -27,7 +30,7 @@ test_expect_success 'with no hook (editor)' '
30 echo "more foo" >> file &&
31 git add file &&
32 echo "more foo" > FAKE_MSG &&
30 - GIT_EDITOR="$FAKE_EDITOR" git commit
33 + GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit
34
35 '
36
@@ -44,7 +47,7 @@ test_expect_success '--no-verify with no hook (editor)' '
47 echo "more bar" > file &&
48 git add file &&
49 echo "more bar" > FAKE_MSG &&
47 - GIT_EDITOR="$FAKE_EDITOR" git commit --no-verify
50 + GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify
51
52 '
53
@@ -71,7 +74,7 @@ test_expect_success 'with succeeding hook (editor)' '
74 echo "more more" >> file &&
75 git add file &&
76 echo "more more" > FAKE_MSG &&
74 - GIT_EDITOR="$FAKE_EDITOR" git commit
77 + GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit
78
79 '
80
@@ -88,7 +91,7 @@ test_expect_success '--no-verify with succeeding hook (editor)' '
91 echo "even more more" >> file &&
92 git add file &&
93 echo "even more more" > FAKE_MSG &&
91 - GIT_EDITOR="$FAKE_EDITOR" git commit --no-verify
94 + GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify
95
96 '
97
@@ -111,7 +114,7 @@ test_expect_success 'with failing hook (editor)' '
114 echo "more another" >> file &&
115 git add file &&
116 echo "more another" > FAKE_MSG &&
114 - ! (GIT_EDITOR="$FAKE_EDITOR" git commit)
117 + ! (GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit)
118
119 '
120
@@ -128,7 +131,7 @@ test_expect_success '--no-verify with failing hook (editor)' '
131 echo "more stuff" >> file &&
132 git add file &&
133 echo "more stuff" > FAKE_MSG &&
131 - GIT_EDITOR="$FAKE_EDITOR" git commit --no-verify
134 + GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify
135
136 '
137
@@ -146,7 +149,7 @@ test_expect_success 'with non-executable hook (editor)' '
149 echo "content again" >> file &&
150 git add file &&
151 echo "content again" > FAKE_MSG &&
149 - GIT_EDITOR="$FAKE_EDITOR" git commit -m "content again"
152 + GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -m "content again"
153
154 '
155
@@ -163,7 +166,7 @@ test_expect_success '--no-verify with non-executable hook (editor)' '
166 echo "even more content" >> file &&
167 git add file &&
168 echo "even more content" > FAKE_MSG &&
166 - GIT_EDITOR="$FAKE_EDITOR" git commit --no-verify
169 + GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify
170
171 '
172
@@ -193,7 +196,7 @@ test_expect_success 'hook edits commit message (editor)' '
196 echo "additional content" >> file &&
197 git add file &&
198 echo "additional content" > FAKE_MSG &&
196 - GIT_EDITOR="$FAKE_EDITOR" git commit &&
199 + GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit &&
200 commit_msg_is "new message"
201
202 '
@@ -212,7 +215,7 @@ test_expect_success "hook doesn't edit commit message (editor)" '
215 echo "more plus" >> file &&
216 git add file &&
217 echo "more plus" > FAKE_MSG &&
215 - GIT_EDITOR="$FAKE_EDITOR" git commit --no-verify &&
218 + GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify &&
219 commit_msg_is "more plus"
220
221 '
t/t7505-prepare-commit-msg-hook.sh
+10 -7
@@ -18,6 +18,9 @@ cat > fake-editor <<'EOF'
18 exit 0
19 EOF
20 chmod +x fake-editor
21 +
22 +## Not using test_set_editor here so we can easily ensure the editor variable
23 +## is only set for the editor tests
24 FAKE_EDITOR="$(pwd)/fake-editor"
25 export FAKE_EDITOR
26
@@ -58,7 +61,7 @@ test_expect_success 'with hook (-m editor)' '
61
62 echo "more" >> file &&
63 git add file &&
61 - GIT_EDITOR="$FAKE_EDITOR" git commit -e -m "more more" &&
64 + GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -e -m "more more" &&
65 test "`git log -1 --pretty=format:%s`" = message
66
67 '
@@ -85,7 +88,7 @@ test_expect_success 'with hook (-F editor)' '
88
89 echo "more" >> file &&
90 git add file &&
88 - (echo more more | GIT_EDITOR="$FAKE_EDITOR" git commit -e -F -) &&
91 + (echo more more | GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -e -F -) &&
92 test "`git log -1 --pretty=format:%s`" = message
93
94 '
@@ -104,7 +107,7 @@ test_expect_success 'with hook (editor)' '
107
108 echo "more more" >> file &&
109 git add file &&
107 - GIT_EDITOR="$FAKE_EDITOR" git commit &&
110 + GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit &&
111 test "`git log -1 --pretty=format:%s`" = default
112
113 '
@@ -114,7 +117,7 @@ test_expect_success 'with hook (--amend)' '
117 head=`git rev-parse HEAD` &&
118 echo "more" >> file &&
119 git add file &&
117 - GIT_EDITOR="$FAKE_EDITOR" git commit --amend &&
120 + GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --amend &&
121 test "`git log -1 --pretty=format:%s`" = "$head"
122
123 '
@@ -124,7 +127,7 @@ test_expect_success 'with hook (-c)' '
127 head=`git rev-parse HEAD` &&
128 echo "more" >> file &&
129 git add file &&
127 - GIT_EDITOR="$FAKE_EDITOR" git commit -c $head &&
130 + GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -c $head &&
131 test "`git log -1 --pretty=format:%s`" = "$head"
132
133 '
@@ -139,7 +142,7 @@ test_expect_success 'with failing hook' '
142 head=`git rev-parse HEAD` &&
143 echo "more" >> file &&
144 git add file &&
142 - ! GIT_EDITOR="$FAKE_EDITOR" git commit -c $head
145 + ! GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -c $head
146
147 '
148
@@ -148,7 +151,7 @@ test_expect_success 'with failing hook (--no-verify)' '
151 head=`git rev-parse HEAD` &&
152 echo "more" >> file &&
153 git add file &&
151 - ! GIT_EDITOR="$FAKE_EDITOR" git commit --no-verify -c $head
154 + ! GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify -c $head
155
156 '
157
t/t9100-git-svn-basic.sh
+60 -60
@@ -20,39 +20,39 @@ esac
20 echo 'define NO_SVN_TESTS to skip git-svn tests'
21
22 test_expect_success \
23 - 'initialize git-svn' "
23 + 'initialize git-svn' '
24 mkdir import &&
25 cd import &&
26 echo foo > foo &&
27 ln -s foo foo.link
28 mkdir -p dir/a/b/c/d/e &&
29 - echo 'deep dir' > dir/a/b/c/d/e/file &&
29 + echo "deep dir" > dir/a/b/c/d/e/file &&
30 mkdir bar &&
31 - echo 'zzz' > bar/zzz &&
32 - echo '#!/bin/sh' > exec.sh &&
31 + echo "zzz" > bar/zzz &&
32 + echo "#!/bin/sh" > exec.sh &&
33 chmod +x exec.sh &&
34 - svn import -m 'import for git-svn' . $svnrepo >/dev/null &&
34 + svn import -m "import for git-svn" . "$svnrepo" >/dev/null &&
35 cd .. &&
36 rm -rf import &&
37 - git-svn init $svnrepo"
37 + git-svn init "$svnrepo"'
38
39 test_expect_success \
40 'import an SVN revision into git' \
41 'git-svn fetch'
42
43 -test_expect_success "checkout from svn" "svn co $svnrepo '$SVN_TREE'"
43 +test_expect_success "checkout from svn" 'svn co "$svnrepo" "$SVN_TREE"'
44
45 name='try a deep --rmdir with a commit'
46 -test_expect_success "$name" "
46 +test_expect_success "$name" '
47 git checkout -f -b mybranch remotes/git-svn &&
48 mv dir/a/b/c/d/e/file dir/file &&
49 cp dir/file file &&
50 git update-index --add --remove dir/a/b/c/d/e/file dir/file file &&
51 - git commit -m '$name' &&
51 + git commit -m "$name" &&
52 git-svn set-tree --find-copies-harder --rmdir \
53 remotes/git-svn..mybranch &&
54 - svn up '$SVN_TREE' &&
55 - test -d '$SVN_TREE'/dir && test ! -d '$SVN_TREE'/dir/a"
54 + svn up "$SVN_TREE" &&
55 + test -d "$SVN_TREE"/dir && test ! -d "$SVN_TREE"/dir/a'
56
57
58 name='detect node change from file to directory #1'
@@ -68,108 +68,108 @@ test_expect_success "$name" "
68
69
70 name='detect node change from directory to file #1'
71 -test_expect_success "$name" "
72 - rm -rf dir '$GIT_DIR'/index &&
71 +test_expect_success "$name" '
72 + rm -rf dir "$GIT_DIR"/index &&
73 git checkout -f -b mybranch2 remotes/git-svn &&
74 mv bar/zzz zzz &&
75 rm -rf bar &&
76 mv zzz bar &&
77 git update-index --remove -- bar/zzz &&
78 git update-index --add -- bar &&
79 - git commit -m '$name' &&
79 + git commit -m "$name" &&
80 ! git-svn set-tree --find-copies-harder --rmdir \
81 - remotes/git-svn..mybranch2" || true
81 + remotes/git-svn..mybranch2' || true
82
83
84 name='detect node change from file to directory #2'
85 -test_expect_success "$name" "
86 - rm -f '$GIT_DIR'/index &&
85 +test_expect_success "$name" '
86 + rm -f "$GIT_DIR"/index &&
87 git checkout -f -b mybranch3 remotes/git-svn &&
88 rm bar/zzz &&
89 git update-index --remove bar/zzz &&
90 mkdir bar/zzz &&
91 echo yyy > bar/zzz/yyy &&
92 git update-index --add bar/zzz/yyy &&
93 - git commit -m '$name' &&
93 + git commit -m "$name" &&
94 ! git-svn set-tree --find-copies-harder --rmdir \
95 - remotes/git-svn..mybranch3" || true
95 + remotes/git-svn..mybranch3' || true
96
97
98 name='detect node change from directory to file #2'
99 -test_expect_success "$name" "
100 - rm -f '$GIT_DIR'/index &&
99 +test_expect_success "$name" '
100 + rm -f "$GIT_DIR"/index &&
101 git checkout -f -b mybranch4 remotes/git-svn &&
102 rm -rf dir &&
103 git update-index --remove -- dir/file &&
104 touch dir &&
105 echo asdf > dir &&
106 git update-index --add -- dir &&
107 - git commit -m '$name' &&
107 + git commit -m "$name" &&
108 ! git-svn set-tree --find-copies-harder --rmdir \
109 - remotes/git-svn..mybranch4" || true
109 + remotes/git-svn..mybranch4' || true
110
111
112 name='remove executable bit from a file'
113 -test_expect_success "$name" "
114 - rm -f '$GIT_DIR'/index &&
113 +test_expect_success "$name" '
114 + rm -f "$GIT_DIR"/index &&
115 git checkout -f -b mybranch5 remotes/git-svn &&
116 chmod -x exec.sh &&
117 git update-index exec.sh &&
118 - git commit -m '$name' &&
118 + git commit -m "$name" &&
119 git-svn set-tree --find-copies-harder --rmdir \
120 remotes/git-svn..mybranch5 &&
121 - svn up '$SVN_TREE' &&
122 - test ! -x '$SVN_TREE'/exec.sh"
121 + svn up "$SVN_TREE" &&
122 + test ! -x "$SVN_TREE"/exec.sh'
123
124
125 name='add executable bit back file'
126 -test_expect_success "$name" "
126 +test_expect_success "$name" '
127 chmod +x exec.sh &&
128 git update-index exec.sh &&
129 - git commit -m '$name' &&
129 + git commit -m "$name" &&
130 git-svn set-tree --find-copies-harder --rmdir \
131 remotes/git-svn..mybranch5 &&
132 - svn up '$SVN_TREE' &&
133 - test -x '$SVN_TREE'/exec.sh"
132 + svn up "$SVN_TREE" &&
133 + test -x "$SVN_TREE"/exec.sh'
134
135
136 name='executable file becomes a symlink to bar/zzz (file)'
137 -test_expect_success "$name" "
137 +test_expect_success "$name" '
138 rm exec.sh &&
139 ln -s bar/zzz exec.sh &&
140 git update-index exec.sh &&
141 - git commit -m '$name' &&
141 + git commit -m "$name" &&
142 git-svn set-tree --find-copies-harder --rmdir \
143 remotes/git-svn..mybranch5 &&
144 - svn up '$SVN_TREE' &&
145 - test -L '$SVN_TREE'/exec.sh"
144 + svn up "$SVN_TREE" &&
145 + test -L "$SVN_TREE"/exec.sh'
146
147 name='new symlink is added to a file that was also just made executable'
148
149 -test_expect_success "$name" "
149 +test_expect_success "$name" '
150 chmod +x bar/zzz &&
151 ln -s bar/zzz exec-2.sh &&
152 git update-index --add bar/zzz exec-2.sh &&
153 - git commit -m '$name' &&
153 + git commit -m "$name" &&
154 git-svn set-tree --find-copies-harder --rmdir \
155 remotes/git-svn..mybranch5 &&
156 - svn up '$SVN_TREE' &&
157 - test -x '$SVN_TREE'/bar/zzz &&
158 - test -L '$SVN_TREE'/exec-2.sh"
156 + svn up "$SVN_TREE" &&
157 + test -x "$SVN_TREE"/bar/zzz &&
158 + test -L "$SVN_TREE"/exec-2.sh'
159
160 name='modify a symlink to become a file'
161 -test_expect_success "$name" "
161 +test_expect_success "$name" '
162 echo git help > help || true &&
163 rm exec-2.sh &&
164 cp help exec-2.sh &&
165 git update-index exec-2.sh &&
166 - git commit -m '$name' &&
166 + git commit -m "$name" &&
167 git-svn set-tree --find-copies-harder --rmdir \
168 remotes/git-svn..mybranch5 &&
169 - svn up '$SVN_TREE' &&
170 - test -f '$SVN_TREE'/exec-2.sh &&
171 - test ! -L '$SVN_TREE'/exec-2.sh &&
172 - git diff help $SVN_TREE/exec-2.sh"
169 + svn up "$SVN_TREE" &&
170 + test -f "$SVN_TREE"/exec-2.sh &&
171 + test ! -L "$SVN_TREE"/exec-2.sh &&
172 + git diff help "$SVN_TREE"/exec-2.sh'
173
174 if test "$have_utf8" = t
175 then
@@ -190,10 +190,10 @@ name='test fetch functionality (svn => git) with alternate GIT_SVN_ID'
190 GIT_SVN_ID=alt
191 export GIT_SVN_ID
192 test_expect_success "$name" \
193 - "git-svn init $svnrepo && git-svn fetch &&
193 + 'git-svn init "$svnrepo" && git-svn fetch &&
194 git rev-list --pretty=raw remotes/git-svn | grep ^tree | uniq > a &&
195 git rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&
196 - git diff a b"
196 + git diff a b'
197
198 name='check imported tree checksums expected tree checksums'
199 rm -f expected
@@ -219,22 +219,22 @@ test_expect_success 'exit if remote refs are ambigious' "
219 ! git-svn migrate
220 "
221
222 -test_expect_success 'exit if init-ing a would clobber a URL' "
223 - svnadmin create ${PWD}/svnrepo2 &&
224 - svn mkdir -m 'mkdir bar' ${svnrepo}2/bar &&
222 +test_expect_success 'exit if init-ing a would clobber a URL' '
223 + svnadmin create "${PWD}/svnrepo2" &&
224 + svn mkdir -m "mkdir bar" "${svnrepo}2/bar" &&
225 git config --unset svn-remote.svn.fetch \
226 - '^bar:refs/remotes/git-svn$' &&
227 - ! git-svn init ${svnrepo}2/bar
228 - "
226 + "^bar:refs/remotes/git-svn$" &&
227 + ! git-svn init "${svnrepo}2/bar"
228 + '
229
230 test_expect_success \
231 - 'init allows us to connect to another directory in the same repo' "
232 - git-svn init --minimize-url -i bar $svnrepo/bar &&
231 + 'init allows us to connect to another directory in the same repo' '
232 + git-svn init --minimize-url -i bar "$svnrepo/bar" &&
233 git config --get svn-remote.svn.fetch \
234 - '^bar:refs/remotes/bar$' &&
234 + "^bar:refs/remotes/bar$" &&
235 git config --get svn-remote.svn.fetch \
236 - '^:refs/remotes/git-svn$'
237 - "
236 + "^:refs/remotes/git-svn$"
237 + '
238
239 test_expect_success 'able to dcommit to a subdirectory' "
240 git-svn fetch -i bar &&
t/t9101-git-svn-props.sh
+4 -4
@@ -52,7 +52,7 @@ EOF
52 cd ..
53
54 rm -rf import
55 -test_expect_success 'checkout working copy from svn' "svn co $svnrepo test_wc"
55 +test_expect_success 'checkout working copy from svn' 'svn co "$svnrepo" test_wc'
56 test_expect_success 'setup some commits to svn' \
57 'cd test_wc &&
58 echo Greetings >> kw.c &&
@@ -66,7 +66,7 @@ test_expect_success 'setup some commits to svn' \
66 svn commit -m "Propset Id" &&
67 cd ..'
68
69 -test_expect_success 'initialize git-svn' "git-svn init $svnrepo"
69 +test_expect_success 'initialize git-svn' 'git-svn init "$svnrepo"'
70 test_expect_success 'fetch revisions from svn' 'git-svn fetch'
71
72 name='test svn:keywords ignoring'
@@ -90,9 +90,9 @@ test_expect_success "propset CR on crlf files" \
90 cd ..'
91
92 test_expect_success 'fetch and pull latest from svn and checkout a new wc' \
93 - "git-svn fetch &&
93 + 'git-svn fetch &&
94 git pull . remotes/git-svn &&
95 - svn co $svnrepo new_wc"
95 + svn co "$svnrepo" new_wc'
96
97 for i in crlf ne_crlf lf ne_lf cr ne_cr empty_cr empty_lf empty empty_crlf
98 do
t/t9102-git-svn-deep-rmdir.sh
+10 -10
@@ -2,29 +2,29 @@
2 test_description='git-svn rmdir'
3 . ./lib-git-svn.sh
4
5 -test_expect_success 'initialize repo' "
5 +test_expect_success 'initialize repo' '
6 mkdir import &&
7 cd import &&
8 mkdir -p deeply/nested/directory/number/1 &&
9 mkdir -p deeply/nested/directory/number/2 &&
10 echo foo > deeply/nested/directory/number/1/file &&
11 echo foo > deeply/nested/directory/number/2/another &&
12 - svn import -m 'import for git-svn' . $svnrepo &&
12 + svn import -m "import for git-svn" . "$svnrepo" &&
13 cd ..
14 - "
14 + '
15
16 -test_expect_success 'mirror via git-svn' "
17 - git-svn init $svnrepo &&
16 +test_expect_success 'mirror via git-svn' '
17 + git-svn init "$svnrepo" &&
18 git-svn fetch &&
19 git checkout -f -b test-rmdir remotes/git-svn
20 - "
20 + '
21
22 -test_expect_success 'Try a commit on rmdir' "
22 +test_expect_success 'Try a commit on rmdir' '
23 git rm -f deeply/nested/directory/number/2/another &&
24 - git commit -a -m 'remove another' &&
24 + git commit -a -m "remove another" &&
25 git-svn set-tree --rmdir HEAD &&
26 - svn ls -R $svnrepo | grep ^deeply/nested/directory/number/1
27 - "
26 + svn ls -R "$svnrepo" | grep ^deeply/nested/directory/number/1
27 + '
28
29
30 test_done
t/t9103-git-svn-tracked-directory-removed.sh
+10 -10
@@ -10,30 +10,30 @@ test_expect_success 'make history for tracking' '
10 mkdir import &&
11 mkdir import/trunk &&
12 echo hello >> import/trunk/README &&
13 - svn import -m initial import $svnrepo &&
13 + svn import -m initial import "$svnrepo" &&
14 rm -rf import &&
15 - svn co $svnrepo/trunk trunk &&
15 + svn co "$svnrepo"/trunk trunk &&
16 echo bye bye >> trunk/README &&
17 - svn rm -m "gone" $svnrepo/trunk &&
17 + svn rm -m "gone" "$svnrepo"/trunk &&
18 rm -rf trunk &&
19 mkdir trunk &&
20 echo "new" > trunk/FOLLOWME &&
21 - svn import -m "new trunk" trunk $svnrepo/trunk
21 + svn import -m "new trunk" trunk "$svnrepo"/trunk
22 '
23
24 test_expect_success 'clone repo with git' '
25 - git svn clone -s $svnrepo x &&
25 + git svn clone -s "$svnrepo" x &&
26 test -f x/FOLLOWME &&
27 test ! -f x/README
28 '
29
30 -test_expect_success 'make sure r2 still has old file' '
30 +test_expect_success 'make sure r2 still has old file' "
31 cd x &&
32 - test -n "$(git svn find-rev r1)" &&
33 - git reset --hard $(git svn find-rev r1) &&
32 + test -n \"\$(git svn find-rev r1)\" &&
33 + git reset --hard \$(git svn find-rev r1) &&
34 test -f README &&
35 test ! -f FOLLOWME &&
36 - test x$(git svn find-rev r2) = x
37 -'
36 + test x\$(git svn find-rev r2) = x
37 +"
38
39 test_done
t/t9104-git-svn-follow-parent.sh
+86 -86
@@ -6,165 +6,165 @@
6 test_description='git-svn fetching'
7 . ./lib-git-svn.sh
8
9 -test_expect_success 'initialize repo' "
9 +test_expect_success 'initialize repo' '
10 mkdir import &&
11 cd import &&
12 mkdir -p trunk &&
13 echo hello > trunk/readme &&
14 - svn import -m 'initial' . $svnrepo &&
14 + svn import -m "initial" . "$svnrepo" &&
15 cd .. &&
16 - svn co $svnrepo wc &&
16 + svn co "$svnrepo" wc &&
17 cd wc &&
18 echo world >> trunk/readme &&
19 poke trunk/readme &&
20 - svn commit -m 'another commit' &&
20 + svn commit -m "another commit" &&
21 svn up &&
22 svn mv trunk thunk &&
23 echo goodbye >> thunk/readme &&
24 poke thunk/readme &&
25 - svn commit -m 'bye now' &&
25 + svn commit -m "bye now" &&
26 cd ..
27 - "
27 + '
28
29 -test_expect_success 'init and fetch a moved directory' "
30 - git-svn init --minimize-url -i thunk $svnrepo/thunk &&
29 +test_expect_success 'init and fetch a moved directory' '
30 + git-svn init --minimize-url -i thunk "$svnrepo"/thunk &&
31 git-svn fetch -i thunk &&
32 - test \"\`git rev-parse --verify refs/remotes/thunk@2\`\" \
33 - = \"\`git rev-parse --verify refs/remotes/thunk~1\`\" &&
34 - test \"\`git cat-file blob refs/remotes/thunk:readme |\
35 - sed -n -e '3p'\`\" = goodbye &&
36 - test -z \"\`git config --get svn-remote.svn.fetch \
37 - '^trunk:refs/remotes/thunk@2$'\`\"
38 - "
32 + test "`git rev-parse --verify refs/remotes/thunk@2`" \
33 + = "`git rev-parse --verify refs/remotes/thunk~1`" &&
34 + test "`git cat-file blob refs/remotes/thunk:readme |\
35 + sed -n -e "3p"`" = goodbye &&
36 + test -z "`git config --get svn-remote.svn.fetch \
37 + "^trunk:refs/remotes/thunk@2$"`"
38 + '
39
40 -test_expect_success 'init and fetch from one svn-remote' "
41 - git config svn-remote.svn.url $svnrepo &&
40 +test_expect_success 'init and fetch from one svn-remote' '
41 + git config svn-remote.svn.url "$svnrepo" &&
42 git config --add svn-remote.svn.fetch \
43 trunk:refs/remotes/svn/trunk &&
44 git config --add svn-remote.svn.fetch \
45 thunk:refs/remotes/svn/thunk &&
46 git-svn fetch -i svn/thunk &&
47 - test \"\`git rev-parse --verify refs/remotes/svn/trunk\`\" \
48 - = \"\`git rev-parse --verify refs/remotes/svn/thunk~1\`\" &&
49 - test \"\`git cat-file blob refs/remotes/svn/thunk:readme |\
50 - sed -n -e '3p'\`\" = goodbye
51 - "
47 + test "`git rev-parse --verify refs/remotes/svn/trunk`" \
48 + = "`git rev-parse --verify refs/remotes/svn/thunk~1`" &&
49 + test "`git cat-file blob refs/remotes/svn/thunk:readme |\
50 + sed -n -e "3p"`" = goodbye
51 + '
52
53 -test_expect_success 'follow deleted parent' "
54 - (svn cp -m 'resurrecting trunk as junk' \
55 - $svnrepo/trunk@2 $svnrepo/junk ||
56 - svn cp -m 'resurrecting trunk as junk' \
57 - -r2 $svnrepo/trunk $svnrepo/junk) &&
53 +test_expect_success 'follow deleted parent' '
54 + (svn cp -m "resurrecting trunk as junk" \
55 + "$svnrepo"/trunk@2 "$svnrepo"/junk ||
56 + svn cp -m "resurrecting trunk as junk" \
57 + -r2 "$svnrepo"/trunk "$svnrepo"/junk) &&
58 git config --add svn-remote.svn.fetch \
59 junk:refs/remotes/svn/junk &&
60 git-svn fetch -i svn/thunk &&
61 git-svn fetch -i svn/junk &&
62 - test -z \"\`git diff svn/junk svn/trunk\`\" &&
63 - test \"\`git merge-base svn/junk svn/trunk\`\" \
64 - = \"\`git rev-parse svn/trunk\`\"
65 - "
62 + test -z "`git diff svn/junk svn/trunk`" &&
63 + test "`git merge-base svn/junk svn/trunk`" \
64 + = "`git rev-parse svn/trunk`"
65 + '
66
67 -test_expect_success 'follow larger parent' "
67 +test_expect_success 'follow larger parent' '
68 mkdir -p import/trunk/thunk/bump/thud &&
69 echo hi > import/trunk/thunk/bump/thud/file &&
70 - svn import -m 'import a larger parent' import $svnrepo/larger-parent &&
71 - svn cp -m 'hi' $svnrepo/larger-parent $svnrepo/another-larger &&
70 + svn import -m "import a larger parent" import "$svnrepo"/larger-parent &&
71 + svn cp -m "hi" "$svnrepo"/larger-parent "$svnrepo"/another-larger &&
72 git-svn init --minimize-url -i larger \
73 - $svnrepo/another-larger/trunk/thunk/bump/thud &&
73 + "$svnrepo"/another-larger/trunk/thunk/bump/thud &&
74 git-svn fetch -i larger &&
75 git rev-parse --verify refs/remotes/larger &&
76 git rev-parse --verify \
77 refs/remotes/larger-parent/trunk/thunk/bump/thud &&
78 - test \"\`git merge-base \
78 + test "`git merge-base \
79 refs/remotes/larger-parent/trunk/thunk/bump/thud \
80 - refs/remotes/larger\`\" = \
81 - \"\`git rev-parse refs/remotes/larger\`\"
80 + refs/remotes/larger`" = \
81 + "`git rev-parse refs/remotes/larger`"
82 true
83 - "
83 + '
84
85 -test_expect_success 'follow higher-level parent' "
86 - svn mkdir -m 'follow higher-level parent' $svnrepo/blob &&
87 - svn co $svnrepo/blob blob &&
85 +test_expect_success 'follow higher-level parent' '
86 + svn mkdir -m "follow higher-level parent" "$svnrepo"/blob &&
87 + svn co "$svnrepo"/blob blob &&
88 cd blob &&
89 echo hi > hi &&
90 svn add hi &&
91 - svn commit -m 'hihi' &&
91 + svn commit -m "hihi" &&
92 cd ..
93 - svn mkdir -m 'new glob at top level' $svnrepo/glob &&
94 - svn mv -m 'move blob down a level' $svnrepo/blob $svnrepo/glob/blob &&
95 - git-svn init --minimize-url -i blob $svnrepo/glob/blob &&
93 + svn mkdir -m "new glob at top level" "$svnrepo"/glob &&
94 + svn mv -m "move blob down a level" "$svnrepo"/blob "$svnrepo"/glob/blob &&
95 + git-svn init --minimize-url -i blob "$svnrepo"/glob/blob &&
96 git-svn fetch -i blob
97 - "
97 + '
98
99 -test_expect_success 'follow deleted directory' "
100 - svn mv -m 'bye!' $svnrepo/glob/blob/hi $svnrepo/glob/blob/bye &&
101 - svn rm -m 'remove glob' $svnrepo/glob &&
102 - git-svn init --minimize-url -i glob $svnrepo/glob &&
99 +test_expect_success 'follow deleted directory' '
100 + svn mv -m "bye!" "$svnrepo"/glob/blob/hi "$svnrepo"/glob/blob/bye &&
101 + svn rm -m "remove glob" "$svnrepo"/glob &&
102 + git-svn init --minimize-url -i glob "$svnrepo"/glob &&
103 git-svn fetch -i glob &&
104 - test \"\`git cat-file blob refs/remotes/glob:blob/bye\`\" = hi &&
105 - test \"\`git ls-tree refs/remotes/glob | wc -l \`\" -eq 1
106 - "
104 + test "`git cat-file blob refs/remotes/glob:blob/bye`" = hi &&
105 + test "`git ls-tree refs/remotes/glob | wc -l `" -eq 1
106 + '
107
108 # ref: r9270 of the Subversion repository: (http://svn.collab.net/repos/svn)
109 # in trunk/subversion/bindings/swig/perl
110 -test_expect_success 'follow-parent avoids deleting relevant info' "
110 +test_expect_success 'follow-parent avoids deleting relevant info' '
111 mkdir -p import/trunk/subversion/bindings/swig/perl/t &&
112 for i in a b c ; do \
113 - echo \$i > import/trunk/subversion/bindings/swig/perl/\$i.pm &&
114 - echo _\$i > import/trunk/subversion/bindings/swig/perl/t/\$i.t; \
113 + echo $i > import/trunk/subversion/bindings/swig/perl/$i.pm &&
114 + echo _$i > import/trunk/subversion/bindings/swig/perl/t/$i.t; \
115 done &&
116 - echo 'bad delete test' > \
116 + echo "bad delete test" > \
117 import/trunk/subversion/bindings/swig/perl/t/larger-parent &&
118 - echo 'bad delete test 2' > \
118 + echo "bad delete test 2" > \
119 import/trunk/subversion/bindings/swig/perl/another-larger &&
120 cd import &&
121 - svn import -m 'r9270 test' . $svnrepo/r9270 &&
121 + svn import -m "r9270 test" . "$svnrepo"/r9270 &&
122 cd .. &&
123 - svn co $svnrepo/r9270/trunk/subversion/bindings/swig/perl r9270 &&
123 + svn co "$svnrepo"/r9270/trunk/subversion/bindings/swig/perl r9270 &&
124 cd r9270 &&
125 svn mkdir native &&
126 svn mv t native/t &&
127 - for i in a b c; do svn mv \$i.pm native/\$i.pm; done &&
127 + for i in a b c; do svn mv $i.pm native/$i.pm; done &&
128 echo z >> native/t/c.t &&
129 poke native/t/c.t &&
130 - svn commit -m 'reorg test' &&
130 + svn commit -m "reorg test" &&
131 cd .. &&
132 git-svn init --minimize-url -i r9270-t \
133 - $svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t &&
133 + "$svnrepo"/r9270/trunk/subversion/bindings/swig/perl/native/t &&
134 git-svn fetch -i r9270-t &&
135 - test \`git rev-list r9270-t | wc -l\` -eq 2 &&
136 - test \"\`git ls-tree --name-only r9270-t~1\`\" = \
137 - \"\`git ls-tree --name-only r9270-t\`\"
138 - "
135 + test `git rev-list r9270-t | wc -l` -eq 2 &&
136 + test "`git ls-tree --name-only r9270-t~1`" = \
137 + "`git ls-tree --name-only r9270-t`"
138 + '
139
140 -test_expect_success "track initial change if it was only made to parent" "
141 - svn cp -m 'wheee!' $svnrepo/r9270/trunk $svnrepo/r9270/drunk &&
140 +test_expect_success "track initial change if it was only made to parent" '
141 + svn cp -m "wheee!" "$svnrepo"/r9270/trunk "$svnrepo"/r9270/drunk &&
142 git-svn init --minimize-url -i r9270-d \
143 - $svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t &&
143 + "$svnrepo"/r9270/drunk/subversion/bindings/swig/perl/native/t &&
144 git-svn fetch -i r9270-d &&
145 - test \`git rev-list r9270-d | wc -l\` -eq 3 &&
146 - test \"\`git ls-tree --name-only r9270-t\`\" = \
147 - \"\`git ls-tree --name-only r9270-d\`\" &&
148 - test \"\`git rev-parse r9270-t\`\" = \
149 - \"\`git rev-parse r9270-d~1\`\"
150 - "
145 + test `git rev-list r9270-d | wc -l` -eq 3 &&
146 + test "`git ls-tree --name-only r9270-t`" = \
147 + "`git ls-tree --name-only r9270-d`" &&
148 + test "`git rev-parse r9270-t`" = \
149 + "`git rev-parse r9270-d~1`"
150 + '
151
152 -test_expect_success "track multi-parent paths" "
153 - svn cp -m 'resurrect /glob' $svnrepo/r9270 $svnrepo/glob &&
152 +test_expect_success "track multi-parent paths" '
153 + svn cp -m "resurrect /glob" "$svnrepo"/r9270 "$svnrepo"/glob &&
154 git-svn multi-fetch &&
155 - test \`git cat-file commit refs/remotes/glob | \
156 - grep '^parent ' | wc -l\` -eq 2
157 - "
155 + test `git cat-file commit refs/remotes/glob | \
156 + grep "^parent " | wc -l` -eq 2
157 + '
158
159 test_expect_success "multi-fetch continues to work" "
160 git-svn multi-fetch
161 "
162
163 -test_expect_success "multi-fetch works off a 'clean' repository" "
164 - rm -r $GIT_DIR/svn $GIT_DIR/refs/remotes $GIT_DIR/logs &&
165 - mkdir $GIT_DIR/svn &&
163 +test_expect_success "multi-fetch works off a 'clean' repository" '
164 + rm -r "$GIT_DIR/svn" "$GIT_DIR/refs/remotes" "$GIT_DIR/logs" &&
165 + mkdir "$GIT_DIR/svn" &&
166 git-svn multi-fetch
167 - "
167 + '
168
169 test_debug 'gitk --all &'
170
t/t9105-git-svn-commit-diff.sh
+16 -16
@@ -4,18 +4,18 @@
4 test_description='git-svn commit-diff'
5 . ./lib-git-svn.sh
6
7 -test_expect_success 'initialize repo' "
7 +test_expect_success 'initialize repo' '
8 mkdir import &&
9 cd import &&
10 echo hello > readme &&
11 - svn import -m 'initial' . $svnrepo &&
11 + svn import -m "initial" . "$svnrepo" &&
12 cd .. &&
13 echo hello > readme &&
14 git update-index --add readme &&
15 - git commit -a -m 'initial' &&
15 + git commit -a -m "initial" &&
16 echo world >> readme &&
17 - git commit -a -m 'another'
18 - "
17 + git commit -a -m "another"
18 + '
19
20 head=`git rev-parse --verify HEAD^0`
21 prev=`git rev-parse --verify HEAD^1`
@@ -24,20 +24,20 @@ prev=`git rev-parse --verify HEAD^1`
24 # commit, so only a basic test of functionality is needed since we've
25 # already tested commit extensively elsewhere
26
27 -test_expect_success 'test the commit-diff command' "
28 - test -n '$prev' && test -n '$head' &&
29 - git-svn commit-diff -r1 '$prev' '$head' '$svnrepo' &&
30 - svn co $svnrepo wc &&
27 +test_expect_success 'test the commit-diff command' '
28 + test -n "$prev" && test -n "$head" &&
29 + git-svn commit-diff -r1 "$prev" "$head" "$svnrepo" &&
30 + svn co "$svnrepo" wc &&
31 cmp readme wc/readme
32 - "
32 + '
33
34 -test_expect_success 'commit-diff to a sub-directory (with git-svn config)' "
35 - svn import -m 'sub-directory' import $svnrepo/subdir &&
36 - git-svn init --minimize-url $svnrepo/subdir &&
34 +test_expect_success 'commit-diff to a sub-directory (with git-svn config)' '
35 + svn import -m "sub-directory" import "$svnrepo"/subdir &&
36 + git-svn init --minimize-url "$svnrepo"/subdir &&
37 git-svn fetch &&
38 - git-svn commit-diff -r3 '$prev' '$head' &&
39 - svn cat $svnrepo/subdir/readme > readme.2 &&
38 + git-svn commit-diff -r3 "$prev" "$head" &&
39 + svn cat "$svnrepo"/subdir/readme > readme.2 &&
40 cmp readme readme.2
41 - "
41 + '
42
43 test_done
t/t9106-git-svn-commit-diff-clobber.sh
+28 -28
@@ -4,56 +4,56 @@
4 test_description='git-svn commit-diff clobber'
5 . ./lib-git-svn.sh
6
7 -test_expect_success 'initialize repo' "
7 +test_expect_success 'initialize repo' '
8 mkdir import &&
9 cd import &&
10 echo initial > file &&
11 - svn import -m 'initial' . $svnrepo &&
11 + svn import -m "initial" . "$svnrepo" &&
12 cd .. &&
13 echo initial > file &&
14 git update-index --add file &&
15 - git commit -a -m 'initial'
16 - "
17 -test_expect_success 'commit change from svn side' "
18 - svn co $svnrepo t.svn &&
15 + git commit -a -m "initial"
16 + '
17 +test_expect_success 'commit change from svn side' '
18 + svn co "$svnrepo" t.svn &&
19 cd t.svn &&
20 echo second line from svn >> file &&
21 poke file &&
22 - svn commit -m 'second line from svn' &&
22 + svn commit -m "second line from svn" &&
23 cd .. &&
24 rm -rf t.svn
25 - "
25 + '
26
27 -test_expect_success 'commit conflicting change from git' "
27 +test_expect_success 'commit conflicting change from git' '
28 echo second line from git >> file &&
29 - git commit -a -m 'second line from git' &&
30 - ! git-svn commit-diff -r1 HEAD~1 HEAD $svnrepo
31 -"
29 + git commit -a -m "second line from git" &&
30 + ! git-svn commit-diff -r1 HEAD~1 HEAD "$svnrepo"
31 +'
32
33 -test_expect_success 'commit complementing change from git' "
33 +test_expect_success 'commit complementing change from git' '
34 git reset --hard HEAD~1 &&
35 echo second line from svn >> file &&
36 - git commit -a -m 'second line from svn' &&
36 + git commit -a -m "second line from svn" &&
37 echo third line from git >> file &&
38 - git commit -a -m 'third line from git' &&
39 - git-svn commit-diff -r2 HEAD~1 HEAD $svnrepo
40 - "
38 + git commit -a -m "third line from git" &&
39 + git-svn commit-diff -r2 HEAD~1 HEAD "$svnrepo"
40 + '
41
42 -test_expect_success 'dcommit fails to commit because of conflict' "
43 - git-svn init $svnrepo &&
42 +test_expect_success 'dcommit fails to commit because of conflict' '
43 + git-svn init "$svnrepo" &&
44 git-svn fetch &&
45 git reset --hard refs/remotes/git-svn &&
46 - svn co $svnrepo t.svn &&
46 + svn co "$svnrepo" t.svn &&
47 cd t.svn &&
48 echo fourth line from svn >> file &&
49 poke file &&
50 - svn commit -m 'fourth line from svn' &&
50 + svn commit -m "fourth line from svn" &&
51 cd .. &&
52 rm -rf t.svn &&
53 - echo 'fourth line from git' >> file &&
54 - git commit -a -m 'fourth line from git' &&
53 + echo "fourth line from git" >> file &&
54 + git commit -a -m "fourth line from git" &&
55 ! git-svn dcommit
56 - "
56 + '
57
58 test_expect_success 'dcommit does the svn equivalent of an index merge' "
59 git reset --hard refs/remotes/git-svn &&
@@ -66,15 +66,15 @@ test_expect_success 'dcommit does the svn equivalent of an index merge' "
66 git-svn dcommit
67 "
68
69 -test_expect_success 'commit another change from svn side' "
70 - svn co $svnrepo t.svn &&
69 +test_expect_success 'commit another change from svn side' '
70 + svn co "$svnrepo" t.svn &&
71 cd t.svn &&
72 echo third line from svn >> file &&
73 poke file &&
74 - svn commit -m 'third line from svn' &&
74 + svn commit -m "third line from svn" &&
75 cd .. &&
76 rm -rf t.svn
77 - "
77 + '
78
79 test_expect_success 'multiple dcommit from git-svn will not clobber svn' "
80 git reset --hard refs/remotes/git-svn &&
t/t9106-git-svn-dcommit-clobber-series.sh
+15 -15
@@ -4,30 +4,30 @@
4 test_description='git-svn dcommit clobber series'
5 . ./lib-git-svn.sh
6
7 -test_expect_success 'initialize repo' "
7 +test_expect_success 'initialize repo' '
8 mkdir import &&
9 cd import &&
10 - awk 'BEGIN { for (i = 1; i < 64; i++) { print i } }' > file
11 - svn import -m 'initial' . $svnrepo &&
10 + awk "BEGIN { for (i = 1; i < 64; i++) { print i } }" > file
11 + svn import -m "initial" . "$svnrepo" &&
12 cd .. &&
13 - git svn init $svnrepo &&
13 + git svn init "$svnrepo" &&
14 git svn fetch &&
15 test -e file
16 - "
16 + '
17
18 -test_expect_success '(supposedly) non-conflicting change from SVN' "
19 - test x\"\`sed -n -e 58p < file\`\" = x58 &&
20 - test x\"\`sed -n -e 61p < file\`\" = x61 &&
21 - svn co $svnrepo tmp &&
18 +test_expect_success '(supposedly) non-conflicting change from SVN' '
19 + test x"`sed -n -e 58p < file`" = x58 &&
20 + test x"`sed -n -e 61p < file`" = x61 &&
21 + svn co "$svnrepo" tmp &&
22 cd tmp &&
23 - perl -i -p -e 's/^58\$/5588/' file &&
24 - perl -i -p -e 's/^61\$/6611/' file &&
23 + perl -i -p -e "s/^58$/5588/" file &&
24 + perl -i -p -e "s/^61$/6611/" file &&
25 poke file &&
26 - test x\"\`sed -n -e 58p < file\`\" = x5588 &&
27 - test x\"\`sed -n -e 61p < file\`\" = x6611 &&
28 - svn commit -m '58 => 5588, 61 => 6611' &&
26 + test x"`sed -n -e 58p < file`" = x5588 &&
27 + test x"`sed -n -e 61p < file`" = x6611 &&
28 + svn commit -m "58 => 5588, 61 => 6611" &&
29 cd ..
30 - "
30 + '
31
32 test_expect_success 'some unrelated changes to git' "
33 echo hi > life &&
t/t9107-git-svn-migrate.sh
+62 -62
@@ -3,61 +3,61 @@
3 test_description='git-svn metadata migrations from previous versions'
4 . ./lib-git-svn.sh
5
6 -test_expect_success 'setup old-looking metadata' "
7 - cp $GIT_DIR/config $GIT_DIR/config-old-git-svn &&
6 +test_expect_success 'setup old-looking metadata' '
7 + cp "$GIT_DIR"/config "$GIT_DIR"/config-old-git-svn &&
8 mkdir import &&
9 cd import &&
10 for i in trunk branches/a branches/b \
11 tags/0.1 tags/0.2 tags/0.3; do
12 - mkdir -p \$i && \
13 - echo hello >> \$i/README || exit 1
12 + mkdir -p $i && \
13 + echo hello >> $i/README || exit 1
14 done && \
15 - svn import -m test . $svnrepo
15 + svn import -m test . "$svnrepo"
16 cd .. &&
17 - git-svn init $svnrepo &&
17 + git-svn init "$svnrepo" &&
18 git-svn fetch &&
19 - mv $GIT_DIR/svn/* $GIT_DIR/ &&
20 - mv $GIT_DIR/svn/.metadata $GIT_DIR/ &&
21 - rmdir $GIT_DIR/svn &&
19 + mv "$GIT_DIR"/svn/* "$GIT_DIR"/ &&
20 + mv "$GIT_DIR"/svn/.metadata "$GIT_DIR"/ &&
21 + rmdir "$GIT_DIR"/svn &&
22 git update-ref refs/heads/git-svn-HEAD refs/remotes/git-svn &&
23 git update-ref refs/heads/svn-HEAD refs/remotes/git-svn &&
24 git update-ref -d refs/remotes/git-svn refs/remotes/git-svn
25 - "
25 + '
26
27 head=`git rev-parse --verify refs/heads/git-svn-HEAD^0`
28 test_expect_success 'git-svn-HEAD is a real HEAD' "test -n '$head'"
29
30 -test_expect_success 'initialize old-style (v0) git-svn layout' "
31 - mkdir -p $GIT_DIR/git-svn/info $GIT_DIR/svn/info &&
32 - echo $svnrepo > $GIT_DIR/git-svn/info/url &&
33 - echo $svnrepo > $GIT_DIR/svn/info/url &&
30 +test_expect_success 'initialize old-style (v0) git-svn layout' '
31 + mkdir -p "$GIT_DIR"/git-svn/info "$GIT_DIR"/svn/info &&
32 + echo "$svnrepo" > "$GIT_DIR"/git-svn/info/url &&
33 + echo "$svnrepo" > "$GIT_DIR"/svn/info/url &&
34 git-svn migrate &&
35 - ! test -d $GIT_DIR/git-svn &&
35 + ! test -d "$GIT_DIR"/git-svn &&
36 git rev-parse --verify refs/remotes/git-svn^0 &&
37 git rev-parse --verify refs/remotes/svn^0 &&
38 - test \`git config --get svn-remote.svn.url\` = '$svnrepo' &&
39 - test \`git config --get svn-remote.svn.fetch\` = \
40 - ':refs/remotes/git-svn'
41 - "
38 + test "$(git config --get svn-remote.svn.url)" = "$svnrepo" &&
39 + test `git config --get svn-remote.svn.fetch` = \
40 + ":refs/remotes/git-svn"
41 + '
42
43 -test_expect_success 'initialize a multi-repository repo' "
44 - git-svn init $svnrepo -T trunk -t tags -b branches &&
43 +test_expect_success 'initialize a multi-repository repo' '
44 + git-svn init "$svnrepo" -T trunk -t tags -b branches &&
45 git config --get-all svn-remote.svn.fetch > fetch.out &&
46 - grep '^trunk:refs/remotes/trunk$' fetch.out &&
47 - test -n \"\`git config --get svn-remote.svn.branches \
48 - '^branches/\*:refs/remotes/\*$'\`\" &&
49 - test -n \"\`git config --get svn-remote.svn.tags \
50 - '^tags/\*:refs/remotes/tags/\*$'\`\" &&
46 + grep "^trunk:refs/remotes/trunk$" fetch.out &&
47 + test -n "`git config --get svn-remote.svn.branches \
48 + "^branches/\*:refs/remotes/\*$"`" &&
49 + test -n "`git config --get svn-remote.svn.tags \
50 + "^tags/\*:refs/remotes/tags/\*$"`" &&
51 git config --unset svn-remote.svn.branches \
52 - '^branches/\*:refs/remotes/\*$' &&
52 + "^branches/\*:refs/remotes/\*$" &&
53 git config --unset svn-remote.svn.tags \
54 - '^tags/\*:refs/remotes/tags/\*$' &&
55 - git config --add svn-remote.svn.fetch 'branches/a:refs/remotes/a' &&
56 - git config --add svn-remote.svn.fetch 'branches/b:refs/remotes/b' &&
54 + "^tags/\*:refs/remotes/tags/\*$" &&
55 + git config --add svn-remote.svn.fetch "branches/a:refs/remotes/a" &&
56 + git config --add svn-remote.svn.fetch "branches/b:refs/remotes/b" &&
57 for i in tags/0.1 tags/0.2 tags/0.3; do
58 git config --add svn-remote.svn.fetch \
59 - \$i:refs/remotes/\$i || exit 1; done
60 - "
59 + $i:refs/remotes/$i || exit 1; done
60 + '
61
62 # refs should all be different, but the trees should all be the same:
63 test_expect_success 'multi-fetch works on partial urls + paths' "
@@ -73,43 +73,43 @@ test_expect_success 'multi-fetch works on partial urls + paths' "
73 refs/remotes/\$j\`\" ||exit 1; done; done
74 "
75
76 -test_expect_success 'migrate --minimize on old inited layout' "
76 +test_expect_success 'migrate --minimize on old inited layout' '
77 git config --unset-all svn-remote.svn.fetch &&
78 git config --unset-all svn-remote.svn.url &&
79 - rm -rf $GIT_DIR/svn &&
80 - for i in \`cat fetch.out\`; do
81 - path=\`expr \$i : '\\([^:]*\\):.*$'\`
82 - ref=\`expr \$i : '[^:]*:refs/remotes/\\(.*\\)$'\`
83 - if test -z \"\$ref\"; then continue; fi
84 - if test -n \"\$path\"; then path=\"/\$path\"; fi
85 - ( mkdir -p $GIT_DIR/svn/\$ref/info/ &&
86 - echo $svnrepo\$path > $GIT_DIR/svn/\$ref/info/url ) || exit 1;
79 + rm -rf "$GIT_DIR"/svn &&
80 + for i in `cat fetch.out`; do
81 + path=`expr $i : "\([^:]*\):.*$"`
82 + ref=`expr $i : "[^:]*:refs/remotes/\(.*\)$"`
83 + if test -z "$ref"; then continue; fi
84 + if test -n "$path"; then path="/$path"; fi
85 + ( mkdir -p "$GIT_DIR"/svn/$ref/info/ &&
86 + echo "$svnrepo"$path > "$GIT_DIR"/svn/$ref/info/url ) || exit 1;
87 done &&
88 git-svn migrate --minimize &&
89 - test -z \"\`git config -l |grep -v '^svn-remote\.git-svn\.'\`\" &&
89 + test -z "`git config -l |grep -v "^svn-remote\.git-svn\."`" &&
90 git config --get-all svn-remote.svn.fetch > fetch.out &&
91 - grep '^trunk:refs/remotes/trunk$' fetch.out &&
92 - grep '^branches/a:refs/remotes/a$' fetch.out &&
93 - grep '^branches/b:refs/remotes/b$' fetch.out &&
94 - grep '^tags/0\.1:refs/remotes/tags/0\.1$' fetch.out &&
95 - grep '^tags/0\.2:refs/remotes/tags/0\.2$' fetch.out &&
96 - grep '^tags/0\.3:refs/remotes/tags/0\.3$' fetch.out
97 - grep '^:refs/remotes/git-svn' fetch.out
98 - "
91 + grep "^trunk:refs/remotes/trunk$" fetch.out &&
92 + grep "^branches/a:refs/remotes/a$" fetch.out &&
93 + grep "^branches/b:refs/remotes/b$" fetch.out &&
94 + grep "^tags/0\.1:refs/remotes/tags/0\.1$" fetch.out &&
95 + grep "^tags/0\.2:refs/remotes/tags/0\.2$" fetch.out &&
96 + grep "^tags/0\.3:refs/remotes/tags/0\.3$" fetch.out
97 + grep "^:refs/remotes/git-svn" fetch.out
98 + '
99
100 -test_expect_success ".rev_db auto-converted to .rev_map.UUID" "
100 +test_expect_success ".rev_db auto-converted to .rev_map.UUID" '
101 git-svn fetch -i trunk &&
102 - test -z \"\$(ls $GIT_DIR/svn/trunk/.rev_db.* 2>/dev/null)\" &&
103 - expect=\"\$(ls $GIT_DIR/svn/trunk/.rev_map.*)\" &&
104 - test -n \"\$expect\" &&
105 - rev_db=\$(echo \$expect | sed -e 's,_map,_db,') &&
106 - convert_to_rev_db \$expect \$rev_db &&
107 - rm -f \$expect &&
108 - test -f \$rev_db &&
102 + test -z "$(ls "$GIT_DIR"/svn/trunk/.rev_db.* 2>/dev/null)" &&
103 + expect="$(ls "$GIT_DIR"/svn/trunk/.rev_map.*)" &&
104 + test -n "$expect" &&
105 + rev_db="$(echo $expect | sed -e "s,_map,_db,")" &&
106 + convert_to_rev_db "$expect" "$rev_db" &&
107 + rm -f "$expect" &&
108 + test -f "$rev_db" &&
109 git-svn fetch -i trunk &&
110 - test -z \"\$(ls $GIT_DIR/svn/trunk/.rev_db.* 2>/dev/null)\" &&
111 - test ! -e $GIT_DIR/svn/trunk/.rev_db &&
112 - test -f \$expect
113 - "
110 + test -z "$(ls "$GIT_DIR"/svn/trunk/.rev_db.* 2>/dev/null)" &&
111 + test ! -e "$GIT_DIR"/svn/trunk/.rev_db &&
112 + test -f "$expect"
113 + '
114
115 test_done
t/t9108-git-svn-glob.sh
+38 -38
@@ -10,77 +10,77 @@ start a new branch
10 initial
11 EOF
12
13 -test_expect_success 'test refspec globbing' "
13 +test_expect_success 'test refspec globbing' '
14 mkdir -p trunk/src/a trunk/src/b trunk/doc &&
15 - echo 'hello world' > trunk/src/a/readme &&
16 - echo 'goodbye world' > trunk/src/b/readme &&
17 - svn import -m 'initial' trunk $svnrepo/trunk &&
18 - svn co $svnrepo tmp &&
15 + echo "hello world" > trunk/src/a/readme &&
16 + echo "goodbye world" > trunk/src/b/readme &&
17 + svn import -m "initial" trunk "$svnrepo"/trunk &&
18 + svn co "$svnrepo" tmp &&
19 cd tmp &&
20 mkdir branches tags &&
21 svn add branches tags &&
22 svn cp trunk branches/start &&
23 - svn commit -m 'start a new branch' &&
23 + svn commit -m "start a new branch" &&
24 svn up &&
25 - echo 'hi' >> branches/start/src/b/readme &&
25 + echo "hi" >> branches/start/src/b/readme &&
26 poke branches/start/src/b/readme &&
27 - echo 'hey' >> branches/start/src/a/readme &&
27 + echo "hey" >> branches/start/src/a/readme &&
28 poke branches/start/src/a/readme &&
29 - svn commit -m 'hi' &&
29 + svn commit -m "hi" &&
30 svn up &&
31 svn cp branches/start tags/end &&
32 - echo 'bye' >> tags/end/src/b/readme &&
32 + echo "bye" >> tags/end/src/b/readme &&
33 poke tags/end/src/b/readme &&
34 - echo 'aye' >> tags/end/src/a/readme &&
34 + echo "aye" >> tags/end/src/a/readme &&
35 poke tags/end/src/a/readme &&
36 - svn commit -m 'the end' &&
37 - echo 'byebye' >> tags/end/src/b/readme &&
36 + svn commit -m "the end" &&
37 + echo "byebye" >> tags/end/src/b/readme &&
38 poke tags/end/src/b/readme &&
39 - svn commit -m 'nothing to see here'
39 + svn commit -m "nothing to see here"
40 cd .. &&
41 - git config --add svn-remote.svn.url $svnrepo &&
41 + git config --add svn-remote.svn.url "$svnrepo" &&
42 git config --add svn-remote.svn.fetch \
43 - 'trunk/src/a:refs/remotes/trunk' &&
43 + "trunk/src/a:refs/remotes/trunk" &&
44 git config --add svn-remote.svn.branches \
45 - 'branches/*/src/a:refs/remotes/branches/*' &&
45 + "branches/*/src/a:refs/remotes/branches/*" &&
46 git config --add svn-remote.svn.tags\
47 - 'tags/*/src/a:refs/remotes/tags/*' &&
47 + "tags/*/src/a:refs/remotes/tags/*" &&
48 git-svn multi-fetch &&
49 git log --pretty=oneline refs/remotes/tags/end | \
50 - sed -e 's/^.\{41\}//' > output.end &&
50 + sed -e "s/^.\{41\}//" > output.end &&
51 cmp expect.end output.end &&
52 - test \"\`git rev-parse refs/remotes/tags/end~1\`\" = \
53 - \"\`git rev-parse refs/remotes/branches/start\`\" &&
54 - test \"\`git rev-parse refs/remotes/branches/start~2\`\" = \
55 - \"\`git rev-parse refs/remotes/trunk\`\"
56 - "
52 + test "`git rev-parse refs/remotes/tags/end~1`" = \
53 + "`git rev-parse refs/remotes/branches/start`" &&
54 + test "`git rev-parse refs/remotes/branches/start~2`" = \
55 + "`git rev-parse refs/remotes/trunk`"
56 + '
57
58 echo try to try > expect.two
59 echo nothing to see here >> expect.two
60 cat expect.end >> expect.two
61
62 -test_expect_success 'test left-hand-side only globbing' "
63 - git config --add svn-remote.two.url $svnrepo &&
62 +test_expect_success 'test left-hand-side only globbing' '
63 + git config --add svn-remote.two.url "$svnrepo" &&
64 git config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk &&
65 git config --add svn-remote.two.branches \
66 - 'branches/*:refs/remotes/two/branches/*' &&
66 + "branches/*:refs/remotes/two/branches/*" &&
67 git config --add svn-remote.two.tags \
68 - 'tags/*:refs/remotes/two/tags/*' &&
68 + "tags/*:refs/remotes/two/tags/*" &&
69 cd tmp &&
70 - echo 'try try' >> tags/end/src/b/readme &&
70 + echo "try try" >> tags/end/src/b/readme &&
71 poke tags/end/src/b/readme &&
72 - svn commit -m 'try to try'
72 + svn commit -m "try to try"
73 cd .. &&
74 git-svn fetch two &&
75 - test \`git rev-list refs/remotes/two/tags/end | wc -l\` -eq 6 &&
76 - test \`git rev-list refs/remotes/two/branches/start | wc -l\` -eq 3 &&
77 - test \`git rev-parse refs/remotes/two/branches/start~2\` = \
78 - \`git rev-parse refs/remotes/two/trunk\` &&
79 - test \`git rev-parse refs/remotes/two/tags/end~3\` = \
80 - \`git rev-parse refs/remotes/two/branches/start\` &&
75 + test `git rev-list refs/remotes/two/tags/end | wc -l` -eq 6 &&
76 + test `git rev-list refs/remotes/two/branches/start | wc -l` -eq 3 &&
77 + test `git rev-parse refs/remotes/two/branches/start~2` = \
78 + `git rev-parse refs/remotes/two/trunk` &&
79 + test `git rev-parse refs/remotes/two/tags/end~3` = \
80 + `git rev-parse refs/remotes/two/branches/start` &&
81 git log --pretty=oneline refs/remotes/two/tags/end | \
82 - sed -e 's/^.\{41\}//' > output.two &&
82 + sed -e "s/^.\{41\}//" > output.two &&
83 cmp expect.two output.two
84 - "
84 + '
85
86 test_done
t/t9110-git-svn-use-svm-props.sh
+6 -6
@@ -7,15 +7,15 @@ test_description='git-svn useSvmProps test'
7
8 . ./lib-git-svn.sh
9
10 -test_expect_success 'load svm repo' "
11 - svnadmin load -q $rawsvnrepo < ../t9110/svm.dump &&
12 - git-svn init --minimize-url -R arr -i bar $svnrepo/mirror/arr &&
13 - git-svn init --minimize-url -R argh -i dir $svnrepo/mirror/argh &&
10 +test_expect_success 'load svm repo' '
11 + svnadmin load -q "$rawsvnrepo" < ../t9110/svm.dump &&
12 + git-svn init --minimize-url -R arr -i bar "$svnrepo"/mirror/arr &&
13 + git-svn init --minimize-url -R argh -i dir "$svnrepo"/mirror/argh &&
14 git-svn init --minimize-url -R argh -i e \
15 - $svnrepo/mirror/argh/a/b/c/d/e &&
15 + "$svnrepo"/mirror/argh/a/b/c/d/e &&
16 git config svn.useSvmProps true &&
17 git-svn fetch --all
18 - "
18 + '
19
20 uuid=161ce429-a9dd-4828-af4a-52023f968c89
21
t/t9111-git-svn-use-svnsync-props.sh
+6 -6
@@ -7,14 +7,14 @@ test_description='git-svn useSvnsyncProps test'
7
8 . ./lib-git-svn.sh
9
10 -test_expect_success 'load svnsync repo' "
11 - svnadmin load -q $rawsvnrepo < ../t9111/svnsync.dump &&
12 - git-svn init --minimize-url -R arr -i bar $svnrepo/bar &&
13 - git-svn init --minimize-url -R argh -i dir $svnrepo/dir &&
14 - git-svn init --minimize-url -R argh -i e $svnrepo/dir/a/b/c/d/e &&
10 +test_expect_success 'load svnsync repo' '
11 + svnadmin load -q "$rawsvnrepo" < ../t9111/svnsync.dump &&
12 + git-svn init --minimize-url -R arr -i bar "$svnrepo"/bar &&
13 + git-svn init --minimize-url -R argh -i dir "$svnrepo"/dir &&
14 + git-svn init --minimize-url -R argh -i e "$svnrepo"/dir/a/b/c/d/e &&
15 git config svn.useSvnsyncProps true &&
16 git-svn fetch --all
17 - "
17 + '
18
19 uuid=161ce429-a9dd-4828-af4a-52023f968c89
20
t/t9112-git-svn-md5less-file.sh
+2 -2
@@ -40,8 +40,8 @@ PROPS-END
40
41 EOF
42
43 -test_expect_success 'load svn dumpfile' "svnadmin load $rawsvnrepo < dumpfile.svn"
43 +test_expect_success 'load svn dumpfile' 'svnadmin load "$rawsvnrepo" < dumpfile.svn'
44
45 -test_expect_success 'initialize git-svn' "git-svn init $svnrepo"
45 +test_expect_success 'initialize git-svn' 'git-svn init "$svnrepo"'
46 test_expect_success 'fetch revisions from svn' 'git-svn fetch'
47 test_done
t/t9113-git-svn-dcommit-new-file.sh
+5 -5
@@ -15,18 +15,18 @@ test_description='git-svn dcommit new files over svn:// test'
15
16 start_svnserve () {
17 svnserve --listen-port $SVNSERVE_PORT \
18 - --root $rawsvnrepo \
18 + --root "$rawsvnrepo" \
19 --listen-once \
20 --listen-host 127.0.0.1 &
21 }
22
23 -test_expect_success 'start tracking an empty repo' "
24 - svn mkdir -m 'empty dir' $svnrepo/empty-dir &&
25 - echo anon-access = write >> $rawsvnrepo/conf/svnserve.conf &&
23 +test_expect_success 'start tracking an empty repo' '
24 + svn mkdir -m "empty dir" "$svnrepo"/empty-dir &&
25 + echo anon-access = write >> "$rawsvnrepo"/conf/svnserve.conf &&
26 start_svnserve &&
27 git svn init svn://127.0.0.1:$SVNSERVE_PORT &&
28 git svn fetch
29 - "
29 + '
30
31 test_expect_success 'create files in new directory with dcommit' "
32 mkdir git-new-dir &&
t/t9114-git-svn-dcommit-merge.sh
+11 -11
@@ -34,35 +34,35 @@ cat << EOF
34 EOF
35 }
36
37 -test_expect_success 'setup svn repository' "
38 - svn co $svnrepo mysvnwork &&
37 +test_expect_success 'setup svn repository' '
38 + svn co "$svnrepo" mysvnwork &&
39 mkdir -p mysvnwork/trunk &&
40 cd mysvnwork &&
41 big_text_block >> trunk/README &&
42 svn add trunk &&
43 - svn ci -m 'first commit' trunk &&
43 + svn ci -m "first commit" trunk &&
44 cd ..
45 - "
45 + '
46
47 -test_expect_success 'setup git mirror and merge' "
48 - git svn init $svnrepo -t tags -T trunk -b branches &&
47 +test_expect_success 'setup git mirror and merge' '
48 + git svn init "$svnrepo" -t tags -T trunk -b branches &&
49 git svn fetch &&
50 git checkout --track -b svn remotes/trunk &&
51 git checkout -b merge &&
52 echo new file > new_file &&
53 git add new_file &&
54 - git commit -a -m 'New file' &&
54 + git commit -a -m "New file" &&
55 echo hello >> README &&
56 - git commit -a -m 'hello' &&
56 + git commit -a -m "hello" &&
57 echo add some stuff >> new_file &&
58 - git commit -a -m 'add some stuff' &&
58 + git commit -a -m "add some stuff" &&
59 git checkout svn &&
60 mv -f README tmp &&
61 echo friend > README &&
62 cat tmp >> README &&
63 - git commit -a -m 'friend' &&
63 + git commit -a -m "friend" &&
64 git pull . merge
65 - "
65 + '
66
67 test_debug 'gitk --all & sleep 1'
68
t/t9115-git-svn-dcommit-funky-renames.sh
+6 -6
@@ -7,16 +7,16 @@ test_description='git-svn dcommit can commit renames of files with ugly names'
7
8 . ./lib-git-svn.sh
9
10 -test_expect_success 'load repository with strange names' "
11 - svnadmin load -q $rawsvnrepo < ../t9115/funky-names.dump &&
10 +test_expect_success 'load repository with strange names' '
11 + svnadmin load -q "$rawsvnrepo" < ../t9115/funky-names.dump &&
12 start_httpd
13 - "
13 + '
14
15 -test_expect_success 'init and fetch repository' "
16 - git svn init $svnrepo &&
15 +test_expect_success 'init and fetch repository' '
16 + git svn init "$svnrepo" &&
17 git svn fetch &&
18 git reset --hard git-svn
19 - "
19 + '
20
21 test_expect_success 'create file in existing ugly and empty dir' '
22 mkdir "#{bad_directory_name}" &&
t/t9116-git-svn-log.sh
+6 -6
@@ -6,17 +6,17 @@
6 test_description='git-svn log tests'
7 . ./lib-git-svn.sh
8
9 -test_expect_success 'setup repository and import' "
9 +test_expect_success 'setup repository and import' '
10 mkdir import &&
11 cd import &&
12 for i in trunk branches/a branches/b \
13 tags/0.1 tags/0.2 tags/0.3; do
14 - mkdir -p \$i && \
15 - echo hello >> \$i/README || exit 1
14 + mkdir -p $i && \
15 + echo hello >> $i/README || exit 1
16 done && \
17 - svn import -m test . $svnrepo
17 + svn import -m test . "$svnrepo"
18 cd .. &&
19 - git-svn init $svnrepo -T trunk -b branches -t tags &&
19 + git-svn init "$svnrepo" -T trunk -b branches -t tags &&
20 git-svn fetch &&
21 git reset --hard trunk &&
22 echo bye >> README &&
@@ -37,7 +37,7 @@ test_expect_success 'setup repository and import' "
37 echo try >> README &&
38 git commit -a -m try &&
39 git svn dcommit
40 - "
40 + '
41
42 test_expect_success 'run log' "
43 git reset --hard a &&
t/t9117-git-svn-init-clone.sh
+15 -15
@@ -13,43 +13,43 @@ rm -r .git
13 mkdir tmp
14 cd tmp
15
16 -test_expect_success 'setup svnrepo' "
16 +test_expect_success 'setup svnrepo' '
17 mkdir project project/trunk project/branches project/tags &&
18 echo foo > project/trunk/foo &&
19 - svn import -m '$test_description' project $svnrepo/project &&
19 + svn import -m "$test_description" project "$svnrepo"/project &&
20 rm -rf project
21 - "
21 + '
22
23 -test_expect_success 'basic clone' "
23 +test_expect_success 'basic clone' '
24 test ! -d trunk &&
25 - git svn clone $svnrepo/project/trunk &&
25 + git svn clone "$svnrepo"/project/trunk &&
26 test -d trunk/.git/svn &&
27 test -e trunk/foo &&
28 rm -rf trunk
29 - "
29 + '
30
31 -test_expect_success 'clone to target directory' "
31 +test_expect_success 'clone to target directory' '
32 test ! -d target &&
33 - git svn clone $svnrepo/project/trunk target &&
33 + git svn clone "$svnrepo"/project/trunk target &&
34 test -d target/.git/svn &&
35 test -e target/foo &&
36 rm -rf target
37 - "
37 + '
38
39 -test_expect_success 'clone with --stdlayout' "
39 +test_expect_success 'clone with --stdlayout' '
40 test ! -d project &&
41 - git svn clone -s $svnrepo/project &&
41 + git svn clone -s "$svnrepo"/project &&
42 test -d project/.git/svn &&
43 test -e project/foo &&
44 rm -rf project
45 - "
45 + '
46
47 -test_expect_success 'clone to target directory with --stdlayout' "
47 +test_expect_success 'clone to target directory with --stdlayout' '
48 test ! -d target &&
49 - git svn clone -s $svnrepo/project target &&
49 + git svn clone -s "$svnrepo"/project target &&
50 test -d target/.git/svn &&
51 test -e target/foo &&
52 rm -rf target
53 - "
53 + '
54
55 test_done
t/t9118-git-svn-funky-branch-names.sh
+12 -12
@@ -6,25 +6,25 @@
6 test_description='git-svn funky branch names'
7 . ./lib-git-svn.sh
8
9 -test_expect_success 'setup svnrepo' "
9 +test_expect_success 'setup svnrepo' '
10 mkdir project project/trunk project/branches project/tags &&
11 echo foo > project/trunk/foo &&
12 - svn import -m '$test_description' project \"$svnrepo/pr ject\" &&
12 + svn import -m "$test_description" project "$svnrepo/pr ject" &&
13 rm -rf project &&
14 - svn cp -m 'fun' \"$svnrepo/pr ject/trunk\" \
15 - \"$svnrepo/pr ject/branches/fun plugin\" &&
16 - svn cp -m 'more fun!' \"$svnrepo/pr ject/branches/fun plugin\" \
17 - \"$svnrepo/pr ject/branches/more fun plugin!\" &&
14 + svn cp -m "fun" "$svnrepo/pr ject/trunk" \
15 + "$svnrepo/pr ject/branches/fun plugin" &&
16 + svn cp -m "more fun!" "$svnrepo/pr ject/branches/fun plugin" \
17 + "$svnrepo/pr ject/branches/more fun plugin!" &&
18 start_httpd
19 - "
19 + '
20
21 -test_expect_success 'test clone with funky branch names' "
22 - git svn clone -s \"$svnrepo/pr ject\" project &&
21 +test_expect_success 'test clone with funky branch names' '
22 + git svn clone -s "$svnrepo/pr ject" project &&
23 cd project &&
24 - git rev-parse 'refs/remotes/fun%20plugin' &&
25 - git rev-parse 'refs/remotes/more%20fun%20plugin!' &&
24 + git rev-parse "refs/remotes/fun%20plugin" &&
25 + git rev-parse "refs/remotes/more%20fun%20plugin!" &&
26 cd ..
27 - "
27 + '
28
29 test_expect_success 'test dcommit to funky branch' "
30 cd project &&
t/t9120-git-svn-clone-with-percent-escapes.sh
+3 -3
@@ -6,13 +6,13 @@
6 test_description='git-svn clone with percent escapes'
7 . ./lib-git-svn.sh
8
9 -test_expect_success 'setup svnrepo' "
9 +test_expect_success 'setup svnrepo' '
10 mkdir project project/trunk project/branches project/tags &&
11 echo foo > project/trunk/foo &&
12 - svn import -m '$test_description' project '$svnrepo/pr ject' &&
12 + svn import -m "$test_description" project "$svnrepo/pr ject" &&
13 rm -rf project &&
14 start_httpd
15 -"
15 +'
16
17 if test "$SVN_HTTPD_PORT" = ""
18 then
t/t9121-git-svn-fetch-renamed-dir.sh
+6 -6
@@ -7,14 +7,14 @@ test_description='git-svn can fetch renamed directories'
7
8 . ./lib-git-svn.sh
9
10 -test_expect_success 'load repository with renamed directory' "
11 - svnadmin load -q $rawsvnrepo < ../t9121/renamed-dir.dump
12 - "
10 +test_expect_success 'load repository with renamed directory' '
11 + svnadmin load -q "$rawsvnrepo" < ../t9121/renamed-dir.dump
12 + '
13
14 -test_expect_success 'init and fetch repository' "
15 - git svn init $svnrepo/newname &&
14 +test_expect_success 'init and fetch repository' '
15 + git svn init "$svnrepo/newname" &&
16 git svn fetch
17 - "
17 + '
18
19 test_done
20
t/t9400-git-cvsserver-server.sh
+8 -8
@@ -153,21 +153,21 @@ test_expect_success 'req_Root failure (conflicting roots)' \
153 tail log | grep "^error 1 Conflicting roots specified$"'
154
155 test_expect_success 'req_Root (strict paths)' \
156 - 'cat request-anonymous | git-cvsserver --strict-paths pserver $SERVERDIR >log 2>&1 &&
156 + 'cat request-anonymous | git-cvsserver --strict-paths pserver "$SERVERDIR" >log 2>&1 &&
157 sed -ne \$p log | grep "^I LOVE YOU$"'
158
159 test_expect_success 'req_Root failure (strict-paths)' '
160 ! cat request-anonymous |
161 - git-cvsserver --strict-paths pserver $WORKDIR >log 2>&1
161 + git-cvsserver --strict-paths pserver "$WORKDIR" >log 2>&1
162 '
163
164 test_expect_success 'req_Root (w/o strict-paths)' \
165 - 'cat request-anonymous | git-cvsserver pserver $WORKDIR/ >log 2>&1 &&
165 + 'cat request-anonymous | git-cvsserver pserver "$WORKDIR/" >log 2>&1 &&
166 sed -ne \$p log | grep "^I LOVE YOU$"'
167
168 test_expect_success 'req_Root failure (w/o strict-paths)' '
169 ! cat request-anonymous |
170 - git-cvsserver pserver $WORKDIR/gitcvs >log 2>&1
170 + git-cvsserver pserver "$WORKDIR/gitcvs" >log 2>&1
171 '
172
173 cat >request-base <<EOF
@@ -180,25 +180,25 @@ Root /gitcvs.git
180 EOF
181
182 test_expect_success 'req_Root (base-path)' \
183 - 'cat request-base | git-cvsserver --strict-paths --base-path $WORKDIR/ pserver $SERVERDIR >log 2>&1 &&
183 + 'cat request-base | git-cvsserver --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
184 sed -ne \$p log | grep "^I LOVE YOU$"'
185
186 test_expect_success 'req_Root failure (base-path)' '
187 ! cat request-anonymous |
188 - git-cvsserver --strict-paths --base-path $WORKDIR pserver $SERVERDIR >log 2>&1
188 + git-cvsserver --strict-paths --base-path "$WORKDIR" pserver "$SERVERDIR" >log 2>&1
189 '
190
191 GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false || exit 1
192
193 test_expect_success 'req_Root (export-all)' \
194 - 'cat request-anonymous | git-cvsserver --export-all pserver $WORKDIR >log 2>&1 &&
194 + 'cat request-anonymous | git-cvsserver --export-all pserver "$WORKDIR" >log 2>&1 &&
195 sed -ne \$p log | grep "^I LOVE YOU$"'
196
197 test_expect_success 'req_Root failure (export-all w/o whitelist)' \
198 '! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)'
199
200 test_expect_success 'req_Root (everything together)' \
201 - 'cat request-base | git-cvsserver --export-all --strict-paths --base-path $WORKDIR/ pserver $SERVERDIR >log 2>&1 &&
201 + 'cat request-base | git-cvsserver --export-all --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
202 sed -ne \$p log | grep "^I LOVE YOU$"'
203
204 GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true || exit 1
t/t9500-gitweb-standalone-no-errors.sh
+6 -5
@@ -10,6 +10,7 @@ commandline, and checks that it would not write any errors
10 or warnings to log.'
11
12 gitweb_init () {
13 + safe_pwd="$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')"
14 cat >gitweb_config.perl <<EOF
15 #!/usr/bin/perl
16
@@ -17,16 +18,16 @@ gitweb_init () {
18
19 our \$version = "current";
20 our \$GIT = "git";
20 -our \$projectroot = "$(pwd)";
21 +our \$projectroot = "$safe_pwd";
22 our \$project_maxdepth = 8;
23 our \$home_link_str = "projects";
24 our \$site_name = "[localhost]";
25 our \$site_header = "";
26 our \$site_footer = "";
27 our \$home_text = "indextext.html";
27 -our @stylesheets = ("file:///$(pwd)/../../gitweb/gitweb.css");
28 -our \$logo = "file:///$(pwd)/../../gitweb/git-logo.png";
29 -our \$favicon = "file:///$(pwd)/../../gitweb/git-favicon.png";
28 +our @stylesheets = ("file:///$safe_pwd/../../gitweb/gitweb.css");
29 +our \$logo = "file:///$safe_pwd/../../gitweb/git-logo.png";
30 +our \$favicon = "file:///$safe_pwd/../../gitweb/git-favicon.png";
31 our \$projects_list = "";
32 our \$export_ok = "";
33 our \$strict_export = "";
@@ -53,7 +54,7 @@ gitweb_run () {
54 # written to web server logs, so we are not interested in that:
55 # we are interested only in properly formatted errors/warnings
56 rm -f gitweb.log &&
56 - perl -- $(pwd)/../../gitweb/gitweb.perl \
57 + perl -- "$(pwd)/../../gitweb/gitweb.perl" \
58 >/dev/null 2>gitweb.log &&
59 if grep -q -s "^[[]" gitweb.log >/dev/null; then false; else true; fi
60
t/t9600-cvsimport.sh
+1 -1
@@ -36,7 +36,7 @@ test_expect_success 'setup cvsroot' 'cvs init'
36
37 test_expect_success 'setup a cvs module' '
38
39 - mkdir $CVSROOT/module &&
39 + mkdir "$CVSROOT/module" &&
40 cvs co -d module-cvs module &&
41 cd module-cvs &&
42 cat <<EOF >o_fortuna &&