Skip to content

Commit e1c0c15

Browse files
peffgitster
authored andcommitted
t/lib-git-svn: drop $remote_git_svn and $git_svn_id
These variables were added in 16805d3 (t/t91XX-svn: start removing use of "git-" from these tests, 2008-09-08) so that running: git grep git- would return fewer hits. At the time, we were transitioning away from the use of the "dashed" git-foo form. That transition has been over for years, and grepping for "git-" in the test suite yields thousands of hits anyway (all presumably false positives). With their original purpose gone, these variables serve only to obfuscate the tests. Let's get rid of them. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent edec370 commit e1c0c15

11 files changed

+60
-63
lines changed

t/lib-git-svn.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
. ./test-lib.sh
22

3-
remotes_git_svn=remotes/git""-svn
4-
git_svn_id=git""-svn-id
5-
63
if test -n "$NO_SVN_TESTS"
74
then
85
skip_all='skipping git svn tests, NO_SVN_TESTS defined'

t/t9100-git-svn-basic.sh

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ test_expect_success "checkout from svn" 'svn co "$svnrepo" "$SVN_TREE"'
4545

4646
name='try a deep --rmdir with a commit'
4747
test_expect_success "$name" '
48-
git checkout -f -b mybranch ${remotes_git_svn} &&
48+
git checkout -f -b mybranch remotes/git-svn &&
4949
mv dir/a/b/c/d/e/file dir/file &&
5050
cp dir/file file &&
5151
git update-index --add --remove dir/a/b/c/d/e/file dir/file file &&
5252
git commit -m "$name" &&
5353
git svn set-tree --find-copies-harder --rmdir \
54-
${remotes_git_svn}..mybranch &&
54+
remotes/git-svn..mybranch &&
5555
svn_cmd up "$SVN_TREE" &&
5656
test -d "$SVN_TREE"/dir && test ! -d "$SVN_TREE"/dir/a'
5757

@@ -65,37 +65,37 @@ test_expect_success "$name" "
6565
git update-index --add dir/file/file &&
6666
git commit -m '$name' &&
6767
test_must_fail git svn set-tree --find-copies-harder --rmdir \
68-
${remotes_git_svn}..mybranch
68+
remotes/git-svn..mybranch
6969
"
7070

7171

7272
name='detect node change from directory to file #1'
7373
test_expect_success "$name" '
7474
rm -rf dir "$GIT_DIR"/index &&
75-
git checkout -f -b mybranch2 ${remotes_git_svn} &&
75+
git checkout -f -b mybranch2 remotes/git-svn &&
7676
mv bar/zzz zzz &&
7777
rm -rf bar &&
7878
mv zzz bar &&
7979
git update-index --remove -- bar/zzz &&
8080
git update-index --add -- bar &&
8181
git commit -m "$name" &&
8282
test_must_fail git svn set-tree --find-copies-harder --rmdir \
83-
${remotes_git_svn}..mybranch2
83+
remotes/git-svn..mybranch2
8484
'
8585

8686

8787
name='detect node change from file to directory #2'
8888
test_expect_success "$name" '
8989
rm -f "$GIT_DIR"/index &&
90-
git checkout -f -b mybranch3 ${remotes_git_svn} &&
90+
git checkout -f -b mybranch3 remotes/git-svn &&
9191
rm bar/zzz &&
9292
git update-index --remove bar/zzz &&
9393
mkdir bar/zzz &&
9494
echo yyy > bar/zzz/yyy &&
9595
git update-index --add bar/zzz/yyy &&
9696
git commit -m "$name" &&
9797
git svn set-tree --find-copies-harder --rmdir \
98-
${remotes_git_svn}..mybranch3 &&
98+
remotes/git-svn..mybranch3 &&
9999
svn_cmd up "$SVN_TREE" &&
100100
test -d "$SVN_TREE"/bar/zzz &&
101101
test -e "$SVN_TREE"/bar/zzz/yyy
@@ -104,27 +104,27 @@ test_expect_success "$name" '
104104
name='detect node change from directory to file #2'
105105
test_expect_success "$name" '
106106
rm -f "$GIT_DIR"/index &&
107-
git checkout -f -b mybranch4 ${remotes_git_svn} &&
107+
git checkout -f -b mybranch4 remotes/git-svn &&
108108
rm -rf dir &&
109109
git update-index --remove -- dir/file &&
110110
touch dir &&
111111
echo asdf > dir &&
112112
git update-index --add -- dir &&
113113
git commit -m "$name" &&
114114
test_must_fail git svn set-tree --find-copies-harder --rmdir \
115-
${remotes_git_svn}..mybranch4
115+
remotes/git-svn..mybranch4
116116
'
117117

118118

119119
name='remove executable bit from a file'
120120
test_expect_success POSIXPERM "$name" '
121121
rm -f "$GIT_DIR"/index &&
122-
git checkout -f -b mybranch5 ${remotes_git_svn} &&
122+
git checkout -f -b mybranch5 remotes/git-svn &&
123123
chmod -x exec.sh &&
124124
git update-index exec.sh &&
125125
git commit -m "$name" &&
126126
git svn set-tree --find-copies-harder --rmdir \
127-
${remotes_git_svn}..mybranch5 &&
127+
remotes/git-svn..mybranch5 &&
128128
svn_cmd up "$SVN_TREE" &&
129129
test ! -x "$SVN_TREE"/exec.sh'
130130

@@ -135,7 +135,7 @@ test_expect_success POSIXPERM "$name" '
135135
git update-index exec.sh &&
136136
git commit -m "$name" &&
137137
git svn set-tree --find-copies-harder --rmdir \
138-
${remotes_git_svn}..mybranch5 &&
138+
remotes/git-svn..mybranch5 &&
139139
svn_cmd up "$SVN_TREE" &&
140140
test -x "$SVN_TREE"/exec.sh'
141141

@@ -147,7 +147,7 @@ test_expect_success SYMLINKS "$name" '
147147
git update-index exec.sh &&
148148
git commit -m "$name" &&
149149
git svn set-tree --find-copies-harder --rmdir \
150-
${remotes_git_svn}..mybranch5 &&
150+
remotes/git-svn..mybranch5 &&
151151
svn_cmd up "$SVN_TREE" &&
152152
test -h "$SVN_TREE"/exec.sh'
153153

@@ -159,7 +159,7 @@ test_expect_success POSIXPERM,SYMLINKS "$name" '
159159
git update-index --add file exec-2.sh &&
160160
git commit -m "$name" &&
161161
git svn set-tree --find-copies-harder --rmdir \
162-
${remotes_git_svn}..mybranch5 &&
162+
remotes/git-svn..mybranch5 &&
163163
svn_cmd up "$SVN_TREE" &&
164164
test -x "$SVN_TREE"/file &&
165165
test -h "$SVN_TREE"/exec-2.sh'
@@ -172,7 +172,7 @@ test_expect_success POSIXPERM,SYMLINKS "$name" '
172172
git update-index exec-2.sh &&
173173
git commit -m "$name" &&
174174
git svn set-tree --find-copies-harder --rmdir \
175-
${remotes_git_svn}..mybranch5 &&
175+
remotes/git-svn..mybranch5 &&
176176
svn_cmd up "$SVN_TREE" &&
177177
test -f "$SVN_TREE"/exec-2.sh &&
178178
test ! -h "$SVN_TREE"/exec-2.sh &&
@@ -194,7 +194,7 @@ GIT_SVN_ID=alt
194194
export GIT_SVN_ID
195195
test_expect_success "$name" \
196196
'git svn init "$svnrepo" && git svn fetch &&
197-
git rev-list --pretty=raw ${remotes_git_svn} | grep ^tree | uniq > a &&
197+
git rev-list --pretty=raw remotes/git-svn | grep ^tree | uniq > a &&
198198
git rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&
199199
test_cmp a b'
200200

@@ -219,15 +219,15 @@ test_expect_success POSIXPERM,SYMLINKS "$name" "test_cmp a expected"
219219

220220
test_expect_success 'exit if remote refs are ambigious' "
221221
git config --add svn-remote.svn.fetch \
222-
bar:refs/${remotes_git_svn} &&
222+
bar:refs/remotes/git-svn &&
223223
test_must_fail git svn migrate
224224
"
225225

226226
test_expect_success 'exit if init-ing a would clobber a URL' '
227227
svnadmin create "${PWD}/svnrepo2" &&
228228
svn mkdir -m "mkdir bar" "${svnrepo}2/bar" &&
229229
git config --unset svn-remote.svn.fetch \
230-
"^bar:refs/${remotes_git_svn}$" &&
230+
"^bar:refs/remotes/git-svn$" &&
231231
test_must_fail git svn init "${svnrepo}2/bar"
232232
'
233233

@@ -237,7 +237,7 @@ test_expect_success \
237237
git config --get svn-remote.svn.fetch \
238238
"^bar:refs/remotes/bar$" &&
239239
git config --get svn-remote.svn.fetch \
240-
"^:refs/${remotes_git_svn}$"
240+
"^:refs/remotes/git-svn$"
241241
'
242242

243243
test_expect_success 'dcommit $rev does not clobber current branch' '

t/t9101-git-svn-props.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ test_expect_success 'fetch revisions from svn' 'git svn fetch'
7373

7474
name='test svn:keywords ignoring'
7575
test_expect_success "$name" \
76-
'git checkout -b mybranch ${remotes_git_svn} &&
76+
'git checkout -b mybranch remotes/git-svn &&
7777
echo Hi again >> kw.c &&
7878
git commit -a -m "test keywords ignoring" &&
79-
git svn set-tree ${remotes_git_svn}..mybranch &&
80-
git pull . ${remotes_git_svn}'
79+
git svn set-tree remotes/git-svn..mybranch &&
80+
git pull . remotes/git-svn'
8181

8282
expect='/* $Id$ */'
8383
got="$(sed -ne 2p kw.c)"
@@ -95,7 +95,7 @@ test_expect_success "propset CR on crlf files" '
9595

9696
test_expect_success 'fetch and pull latest from svn and checkout a new wc' \
9797
'git svn fetch &&
98-
git pull . ${remotes_git_svn} &&
98+
git pull . remotes/git-svn &&
9999
svn_cmd co "$svnrepo" new_wc'
100100

101101
for i in crlf ne_crlf lf ne_lf cr ne_cr empty_cr empty_lf empty empty_crlf
@@ -117,7 +117,7 @@ cd test_wc
117117
svn_cmd commit -m "propset CRLF on cr files"'
118118
cd ..
119119
test_expect_success 'fetch and pull latest from svn' \
120-
'git svn fetch && git pull . ${remotes_git_svn}'
120+
'git svn fetch && git pull . remotes/git-svn'
121121

122122
b_cr="$(git hash-object cr)"
123123
b_ne_cr="$(git hash-object ne_cr)"
@@ -168,7 +168,7 @@ cat >create-ignore-index.expect <<\EOF
168168
EOF
169169

170170
test_expect_success 'test create-ignore' "
171-
git svn fetch && git pull . ${remotes_git_svn} &&
171+
git svn fetch && git pull . remotes/git-svn &&
172172
git svn create-ignore &&
173173
cmp ./.gitignore create-ignore.expect &&
174174
cmp ./deeply/.gitignore create-ignore.expect &&

t/t9102-git-svn-deep-rmdir.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test_expect_success 'initialize repo' '
1717
test_expect_success 'mirror via git svn' '
1818
git svn init "$svnrepo" &&
1919
git svn fetch &&
20-
git checkout -f -b test-rmdir ${remotes_git_svn}
20+
git checkout -f -b test-rmdir remotes/git-svn
2121
'
2222

2323
test_expect_success 'Try a commit on rmdir' '

t/t9106-git-svn-commit-diff-clobber.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ test_expect_success 'commit complementing change from git' '
4444
test_expect_success 'dcommit fails to commit because of conflict' '
4545
git svn init "$svnrepo" &&
4646
git svn fetch &&
47-
git reset --hard refs/${remotes_git_svn} &&
47+
git reset --hard refs/remotes/git-svn &&
4848
svn_cmd co "$svnrepo" t.svn &&
4949
(
5050
cd t.svn &&
@@ -59,7 +59,7 @@ test_expect_success 'dcommit fails to commit because of conflict' '
5959
'
6060

6161
test_expect_success 'dcommit does the svn equivalent of an index merge' "
62-
git reset --hard refs/${remotes_git_svn} &&
62+
git reset --hard refs/remotes/git-svn &&
6363
echo 'index merge' > file2 &&
6464
git update-index --add file2 &&
6565
git commit -a -m 'index merge' &&
@@ -81,7 +81,7 @@ test_expect_success 'commit another change from svn side' '
8181
'
8282

8383
test_expect_success 'multiple dcommit from git svn will not clobber svn' "
84-
git reset --hard refs/${remotes_git_svn} &&
84+
git reset --hard refs/remotes/git-svn &&
8585
echo new file >> new-file &&
8686
git update-index --add new-file &&
8787
git commit -a -m 'new file' &&

t/t9107-git-svn-migrate.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ test_expect_success 'setup old-looking metadata' '
1919
git svn init "$svnrepo" &&
2020
git svn fetch &&
2121
rm -rf "$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}
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
2525
'
2626

2727
head=$(git rev-parse --verify refs/heads/git-svn-HEAD^0)
@@ -35,11 +35,11 @@ test_expect_success 'initialize old-style (v0) git svn layout' '
3535
echo "$svnrepo" > "$GIT_DIR"/svn/info/url &&
3636
git svn migrate &&
3737
! test -d "$GIT_DIR"/git-svn &&
38-
git rev-parse --verify refs/${remotes_git_svn}^0 &&
38+
git rev-parse --verify refs/remotes/git-svn^0 &&
3939
git rev-parse --verify refs/remotes/svn^0 &&
4040
test "$(git config --get svn-remote.svn.url)" = "$svnrepo_escaped" &&
4141
test $(git config --get svn-remote.svn.fetch) = \
42-
":refs/${remotes_git_svn}"
42+
":refs/remotes/git-svn"
4343
'
4444

4545
test_expect_success 'initialize a multi-repository repo' '
@@ -66,7 +66,7 @@ test_expect_success 'initialize a multi-repository repo' '
6666
grep "^tags/0\.1:refs/remotes/origin/tags/0\.1$" fetch.out &&
6767
grep "^tags/0\.2:refs/remotes/origin/tags/0\.2$" fetch.out &&
6868
grep "^tags/0\.3:refs/remotes/origin/tags/0\.3$" fetch.out &&
69-
grep "^:refs/${remotes_git_svn}" fetch.out
69+
grep "^:refs/remotes/git-svn" fetch.out
7070
'
7171

7272
# refs should all be different, but the trees should all be the same:
@@ -104,7 +104,7 @@ test_expect_success 'migrate --minimize on old inited layout' '
104104
grep "^tags/0\.1:refs/remotes/origin/tags/0\.1$" fetch.out &&
105105
grep "^tags/0\.2:refs/remotes/origin/tags/0\.2$" fetch.out &&
106106
grep "^tags/0\.3:refs/remotes/origin/tags/0\.3$" fetch.out &&
107-
grep "^:refs/${remotes_git_svn}" fetch.out
107+
grep "^:refs/remotes/git-svn" fetch.out
108108
'
109109

110110
test_expect_success ".rev_db auto-converted to .rev_map.UUID" '

t/t9110-git-svn-use-svm-props.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,31 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89
2222
bar_url=http://mayonaise/svnrepo/bar
2323
test_expect_success 'verify metadata for /bar' "
2424
git cat-file commit refs/remotes/bar | \
25-
grep '^${git_svn_id}: $bar_url@12 $uuid$' &&
25+
grep '^git-svn-id: $bar_url@12 $uuid$' &&
2626
git cat-file commit refs/remotes/bar~1 | \
27-
grep '^${git_svn_id}: $bar_url@11 $uuid$' &&
27+
grep '^git-svn-id: $bar_url@11 $uuid$' &&
2828
git cat-file commit refs/remotes/bar~2 | \
29-
grep '^${git_svn_id}: $bar_url@10 $uuid$' &&
29+
grep '^git-svn-id: $bar_url@10 $uuid$' &&
3030
git cat-file commit refs/remotes/bar~3 | \
31-
grep '^${git_svn_id}: $bar_url@9 $uuid$' &&
31+
grep '^git-svn-id: $bar_url@9 $uuid$' &&
3232
git cat-file commit refs/remotes/bar~4 | \
33-
grep '^${git_svn_id}: $bar_url@6 $uuid$' &&
33+
grep '^git-svn-id: $bar_url@6 $uuid$' &&
3434
git cat-file commit refs/remotes/bar~5 | \
35-
grep '^${git_svn_id}: $bar_url@1 $uuid$'
35+
grep '^git-svn-id: $bar_url@1 $uuid$'
3636
"
3737

3838
e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e
3939
test_expect_success 'verify metadata for /dir/a/b/c/d/e' "
4040
git cat-file commit refs/remotes/e | \
41-
grep '^${git_svn_id}: $e_url@1 $uuid$'
41+
grep '^git-svn-id: $e_url@1 $uuid$'
4242
"
4343

4444
dir_url=http://mayonaise/svnrepo/dir
4545
test_expect_success 'verify metadata for /dir' "
4646
git cat-file commit refs/remotes/dir | \
47-
grep '^${git_svn_id}: $dir_url@2 $uuid$' &&
47+
grep '^git-svn-id: $dir_url@2 $uuid$' &&
4848
git cat-file commit refs/remotes/dir~1 | \
49-
grep '^${git_svn_id}: $dir_url@1 $uuid$'
49+
grep '^git-svn-id: $dir_url@1 $uuid$'
5050
"
5151

5252
test_expect_success 'find commit based on SVN revision number' "

t/t9111-git-svn-use-svnsync-props.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,31 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89
2121
bar_url=http://mayonaise/svnrepo/bar
2222
test_expect_success 'verify metadata for /bar' "
2323
git cat-file commit refs/remotes/bar | \
24-
grep '^${git_svn_id}: $bar_url@12 $uuid$' &&
24+
grep '^git-svn-id: $bar_url@12 $uuid$' &&
2525
git cat-file commit refs/remotes/bar~1 | \
26-
grep '^${git_svn_id}: $bar_url@11 $uuid$' &&
26+
grep '^git-svn-id: $bar_url@11 $uuid$' &&
2727
git cat-file commit refs/remotes/bar~2 | \
28-
grep '^${git_svn_id}: $bar_url@10 $uuid$' &&
28+
grep '^git-svn-id: $bar_url@10 $uuid$' &&
2929
git cat-file commit refs/remotes/bar~3 | \
30-
grep '^${git_svn_id}: $bar_url@9 $uuid$' &&
30+
grep '^git-svn-id: $bar_url@9 $uuid$' &&
3131
git cat-file commit refs/remotes/bar~4 | \
32-
grep '^${git_svn_id}: $bar_url@6 $uuid$' &&
32+
grep '^git-svn-id: $bar_url@6 $uuid$' &&
3333
git cat-file commit refs/remotes/bar~5 | \
34-
grep '^${git_svn_id}: $bar_url@1 $uuid$'
34+
grep '^git-svn-id: $bar_url@1 $uuid$'
3535
"
3636

3737
e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e
3838
test_expect_success 'verify metadata for /dir/a/b/c/d/e' "
3939
git cat-file commit refs/remotes/e | \
40-
grep '^${git_svn_id}: $e_url@1 $uuid$'
40+
grep '^git-svn-id: $e_url@1 $uuid$'
4141
"
4242

4343
dir_url=http://mayonaise/svnrepo/dir
4444
test_expect_success 'verify metadata for /dir' "
4545
git cat-file commit refs/remotes/dir | \
46-
grep '^${git_svn_id}: $dir_url@2 $uuid$' &&
46+
grep '^git-svn-id: $dir_url@2 $uuid$' &&
4747
git cat-file commit refs/remotes/dir~1 | \
48-
grep '^${git_svn_id}: $dir_url@1 $uuid$'
48+
grep '^git-svn-id: $dir_url@1 $uuid$'
4949
"
5050

5151
test_done

0 commit comments

Comments
 (0)