]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/t91XX-svn: start removing use of "git-" from these tests
authorNanako Shiraishi <nanako3@lavabit.com>
Mon, 8 Sep 2008 10:02:05 +0000 (19:02 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Sep 2008 21:18:04 +0000 (14:18 -0700)
Subversion tests use too many "git-foo" form, so I am converting them
in two steps.

This first step replaces literal strings "remotes/git-svn" and "git-svn-id"
by introducing $remotes_git_svn and $git_svn_id constants defined as shell
variables.  This will reduce the number of false hits from "git grep".

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-git-svn.sh
t/t9100-git-svn-basic.sh
t/t9101-git-svn-props.sh
t/t9102-git-svn-deep-rmdir.sh
t/t9106-git-svn-commit-diff-clobber.sh
t/t9107-git-svn-migrate.sh
t/t9110-git-svn-use-svm-props.sh
t/t9111-git-svn-use-svnsync-props.sh
t/t9120-git-svn-clone-with-percent-escapes.sh
t/t9123-git-svn-rebuild-with-rewriteroot.sh

index a841df2a9e3a9ed64e81ab7b9778e59cfc714cad..c33dc2d5d518d93f40fa1a230fa1c110c0229820 100644 (file)
@@ -1,5 +1,8 @@
 . ./test-lib.sh
 
+remotes_git_svn=remotes/git""-svn
+git_svn_id=git""-svn-id
+
 if test -n "$NO_SVN_TESTS"
 then
        test_expect_success 'skipping git-svn tests, NO_SVN_TESTS defined' :
index 843a5013b96c675a629bd7f738eca220861e6ff8..5f4cfb6bbaa2b8aa8d24d4db44e04725fa6eed40 100755 (executable)
@@ -44,13 +44,13 @@ test_expect_success "checkout from svn" 'svn co "$svnrepo" "$SVN_TREE"'
 
 name='try a deep --rmdir with a commit'
 test_expect_success "$name" '
-       git checkout -f -b mybranch remotes/git-svn &&
+       git checkout -f -b mybranch ${remotes_git_svn} &&
        mv dir/a/b/c/d/e/file dir/file &&
        cp dir/file file &&
        git update-index --add --remove dir/a/b/c/d/e/file dir/file file &&
        git commit -m "$name" &&
        git-svn set-tree --find-copies-harder --rmdir \
-               remotes/git-svn..mybranch &&
+               ${remotes_git_svn}..mybranch &&
        svn up "$SVN_TREE" &&
        test -d "$SVN_TREE"/dir && test ! -d "$SVN_TREE"/dir/a'
 
@@ -64,13 +64,13 @@ test_expect_success "$name" "
        git update-index --add dir/file/file &&
        git commit -m '$name' &&
        test_must_fail git-svn set-tree --find-copies-harder --rmdir \
-               remotes/git-svn..mybranch" || true
+               ${remotes_git_svn}..mybranch" || true
 
 
 name='detect node change from directory to file #1'
 test_expect_success "$name" '
        rm -rf dir "$GIT_DIR"/index &&
-       git checkout -f -b mybranch2 remotes/git-svn &&
+       git checkout -f -b mybranch2 ${remotes_git_svn} &&
        mv bar/zzz zzz &&
        rm -rf bar &&
        mv zzz bar &&
@@ -78,13 +78,13 @@ test_expect_success "$name" '
        git update-index --add -- bar &&
        git commit -m "$name" &&
        test_must_fail git-svn set-tree --find-copies-harder --rmdir \
-               remotes/git-svn..mybranch2' || true
+               ${remotes_git_svn}..mybranch2' || true
 
 
 name='detect node change from file to directory #2'
 test_expect_success "$name" '
        rm -f "$GIT_DIR"/index &&
-       git checkout -f -b mybranch3 remotes/git-svn &&
+       git checkout -f -b mybranch3 ${remotes_git_svn} &&
        rm bar/zzz &&
        git update-index --remove bar/zzz &&
        mkdir bar/zzz &&
@@ -92,13 +92,13 @@ test_expect_success "$name" '
        git update-index --add bar/zzz/yyy &&
        git commit -m "$name" &&
        test_must_fail git-svn set-tree --find-copies-harder --rmdir \
-               remotes/git-svn..mybranch3' || true
+               ${remotes_git_svn}..mybranch3' || true
 
 
 name='detect node change from directory to file #2'
 test_expect_success "$name" '
        rm -f "$GIT_DIR"/index &&
-       git checkout -f -b mybranch4 remotes/git-svn &&
+       git checkout -f -b mybranch4 ${remotes_git_svn} &&
        rm -rf dir &&
        git update-index --remove -- dir/file &&
        touch dir &&
@@ -106,18 +106,18 @@ test_expect_success "$name" '
        git update-index --add -- dir &&
        git commit -m "$name" &&
        test_must_fail git-svn set-tree --find-copies-harder --rmdir \
-               remotes/git-svn..mybranch4' || true
+               ${remotes_git_svn}..mybranch4' || true
 
 
 name='remove executable bit from a file'
 test_expect_success "$name" '
        rm -f "$GIT_DIR"/index &&
-       git checkout -f -b mybranch5 remotes/git-svn &&
+       git checkout -f -b mybranch5 ${remotes_git_svn} &&
        chmod -x exec.sh &&
        git update-index exec.sh &&
        git commit -m "$name" &&
        git-svn set-tree --find-copies-harder --rmdir \
-               remotes/git-svn..mybranch5 &&
+               ${remotes_git_svn}..mybranch5 &&
        svn up "$SVN_TREE" &&
        test ! -x "$SVN_TREE"/exec.sh'
 
@@ -128,7 +128,7 @@ test_expect_success "$name" '
        git update-index exec.sh &&
        git commit -m "$name" &&
        git-svn set-tree --find-copies-harder --rmdir \
-               remotes/git-svn..mybranch5 &&
+               ${remotes_git_svn}..mybranch5 &&
        svn up "$SVN_TREE" &&
        test -x "$SVN_TREE"/exec.sh'
 
@@ -140,7 +140,7 @@ test_expect_success "$name" '
        git update-index exec.sh &&
        git commit -m "$name" &&
        git-svn set-tree --find-copies-harder --rmdir \
-               remotes/git-svn..mybranch5 &&
+               ${remotes_git_svn}..mybranch5 &&
        svn up "$SVN_TREE" &&
        test -L "$SVN_TREE"/exec.sh'
 
@@ -152,7 +152,7 @@ test_expect_success "$name" '
        git update-index --add bar/zzz exec-2.sh &&
        git commit -m "$name" &&
        git-svn set-tree --find-copies-harder --rmdir \
-               remotes/git-svn..mybranch5 &&
+               ${remotes_git_svn}..mybranch5 &&
        svn up "$SVN_TREE" &&
        test -x "$SVN_TREE"/bar/zzz &&
        test -L "$SVN_TREE"/exec-2.sh'
@@ -165,7 +165,7 @@ test_expect_success "$name" '
        git update-index exec-2.sh &&
        git commit -m "$name" &&
        git-svn set-tree --find-copies-harder --rmdir \
-               remotes/git-svn..mybranch5 &&
+               ${remotes_git_svn}..mybranch5 &&
        svn up "$SVN_TREE" &&
        test -f "$SVN_TREE"/exec-2.sh &&
        test ! -L "$SVN_TREE"/exec-2.sh &&
@@ -191,7 +191,7 @@ GIT_SVN_ID=alt
 export GIT_SVN_ID
 test_expect_success "$name" \
     'git-svn init "$svnrepo" && git-svn fetch &&
-     git rev-list --pretty=raw remotes/git-svn | grep ^tree | uniq > a &&
+     git rev-list --pretty=raw ${remotes_git_svn} | grep ^tree | uniq > a &&
      git rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&
      test_cmp a b'
 
@@ -215,7 +215,7 @@ test_expect_success "$name" "test_cmp a expected"
 
 test_expect_success 'exit if remote refs are ambigious' "
         git config --add svn-remote.svn.fetch \
-                              bar:refs/remotes/git-svn &&
+                              bar:refs/${remotes_git_svn} &&
        test_must_fail git-svn migrate
 "
 
@@ -223,7 +223,7 @@ test_expect_success 'exit if init-ing a would clobber a URL' '
         svnadmin create "${PWD}/svnrepo2" &&
         svn mkdir -m "mkdir bar" "${svnrepo}2/bar" &&
         git config --unset svn-remote.svn.fetch \
-                                "^bar:refs/remotes/git-svn$" &&
+                                "^bar:refs/${remotes_git_svn}$" &&
        test_must_fail git-svn init "${svnrepo}2/bar"
         '
 
@@ -233,7 +233,7 @@ test_expect_success \
         git config --get svn-remote.svn.fetch \
                               "^bar:refs/remotes/bar$" &&
         git config --get svn-remote.svn.fetch \
-                              "^:refs/remotes/git-svn$"
+                              "^:refs/${remotes_git_svn}$"
         '
 
 test_expect_success 'able to dcommit to a subdirectory' "
index f420796c31db2746b71ba9d7090f37363eba214a..02eccc91ba623974e40376ffa4977567868f2e93 100755 (executable)
@@ -71,11 +71,11 @@ test_expect_success 'fetch revisions from svn' 'git-svn fetch'
 
 name='test svn:keywords ignoring'
 test_expect_success "$name" \
-       'git checkout -b mybranch remotes/git-svn &&
+       'git checkout -b mybranch ${remotes_git_svn} &&
        echo Hi again >> kw.c &&
        git commit -a -m "test keywords ignoring" &&
-       git-svn set-tree remotes/git-svn..mybranch &&
-       git pull . remotes/git-svn'
+       git-svn set-tree ${remotes_git_svn}..mybranch &&
+       git pull . ${remotes_git_svn}'
 
 expect='/* $Id$ */'
 got="`sed -ne 2p kw.c`"
@@ -91,7 +91,7 @@ test_expect_success "propset CR on crlf files" \
 
 test_expect_success 'fetch and pull latest from svn and checkout a new wc' \
        'git-svn fetch &&
-        git pull . remotes/git-svn &&
+        git pull . ${remotes_git_svn} &&
         svn co "$svnrepo" new_wc'
 
 for i in crlf ne_crlf lf ne_lf cr ne_cr empty_cr empty_lf empty empty_crlf
@@ -113,7 +113,7 @@ cd test_wc
         svn commit -m "propset CRLF on cr files"'
 cd ..
 test_expect_success 'fetch and pull latest from svn' \
-       'git-svn fetch && git pull . remotes/git-svn'
+       'git-svn fetch && git pull . ${remotes_git_svn}'
 
 b_cr="`git-hash-object cr`"
 b_ne_cr="`git-hash-object ne_cr`"
@@ -161,7 +161,7 @@ cat >create-ignore-index.expect <<\EOF
 EOF
 
 test_expect_success 'test create-ignore' "
-       git-svn fetch && git pull . remotes/git-svn &&
+       git-svn fetch && git pull . ${remotes_git_svn} &&
        git-svn create-ignore &&
        cmp ./.gitignore create-ignore.expect &&
        cmp ./deeply/.gitignore create-ignore.expect &&
index 0e7ce34b9b1e254873a2700cf58095318b49b15c..0ad6e2442c26daef8d48b210eff5a04d6619f0dd 100755 (executable)
@@ -16,7 +16,7 @@ test_expect_success 'initialize repo' '
 test_expect_success 'mirror via git-svn' '
        git-svn init "$svnrepo" &&
        git-svn fetch &&
-       git checkout -f -b test-rmdir remotes/git-svn
+       git checkout -f -b test-rmdir ${remotes_git_svn}
        '
 
 test_expect_success 'Try a commit on rmdir' '
index 83896e96876d8cca24496c7cb278732a308e3d92..da559f89b320ef001d225f9424a8966cf964dfce 100755 (executable)
@@ -42,7 +42,7 @@ test_expect_success 'commit complementing change from git' '
 test_expect_success 'dcommit fails to commit because of conflict' '
        git-svn init "$svnrepo" &&
        git-svn fetch &&
-       git reset --hard refs/remotes/git-svn &&
+       git reset --hard refs/${remotes_git_svn} &&
        svn co "$svnrepo" t.svn &&
        cd t.svn &&
        echo fourth line from svn >> file &&
@@ -56,7 +56,7 @@ test_expect_success 'dcommit fails to commit because of conflict' '
        '
 
 test_expect_success 'dcommit does the svn equivalent of an index merge' "
-       git reset --hard refs/remotes/git-svn &&
+       git reset --hard refs/${remotes_git_svn} &&
        echo 'index merge' > file2 &&
        git update-index --add file2 &&
        git commit -a -m 'index merge' &&
@@ -77,7 +77,7 @@ test_expect_success 'commit another change from svn side' '
        '
 
 test_expect_success 'multiple dcommit from git-svn will not clobber svn' "
-       git reset --hard refs/remotes/git-svn &&
+       git reset --hard refs/${remotes_git_svn} &&
        echo new file >> new-file &&
        git update-index --add new-file &&
        git commit -a -m 'new file' &&
index d9b553ad55b1f7024af0689a450a9c6c65dcb034..f3c75fc141d3877b3ad1afdc957bf5aa54761d93 100755 (executable)
@@ -19,9 +19,9 @@ test_expect_success 'setup old-looking metadata' '
        mv "$GIT_DIR"/svn/* "$GIT_DIR"/ &&
        mv "$GIT_DIR"/svn/.metadata "$GIT_DIR"/ &&
        rmdir "$GIT_DIR"/svn &&
-       git update-ref refs/heads/git-svn-HEAD refs/remotes/git-svn &&
-       git update-ref refs/heads/svn-HEAD refs/remotes/git-svn &&
-       git update-ref -d refs/remotes/git-svn refs/remotes/git-svn
+       git update-ref refs/heads/git-svn-HEAD refs/${remotes_git_svn} &&
+       git update-ref refs/heads/svn-HEAD refs/${remotes_git_svn} &&
+       git update-ref -d refs/${remotes_git_svn} refs/${remotes_git_svn}
        '
 
 head=`git rev-parse --verify refs/heads/git-svn-HEAD^0`
@@ -33,11 +33,11 @@ test_expect_success 'initialize old-style (v0) git-svn layout' '
        echo "$svnrepo" > "$GIT_DIR"/svn/info/url &&
        git-svn migrate &&
        ! test -d "$GIT_DIR"/git-svn &&
-       git rev-parse --verify refs/remotes/git-svn^0 &&
+       git rev-parse --verify refs/${remotes_git_svn}^0 &&
        git rev-parse --verify refs/remotes/svn^0 &&
        test "$(git config --get svn-remote.svn.url)" = "$svnrepo" &&
        test `git config --get svn-remote.svn.fetch` = \
-             ":refs/remotes/git-svn"
+             ":refs/${remotes_git_svn}"
        '
 
 test_expect_success 'initialize a multi-repository repo' '
@@ -94,7 +94,7 @@ test_expect_success 'migrate --minimize on old inited layout' '
        grep "^tags/0\.1:refs/remotes/tags/0\.1$" fetch.out &&
        grep "^tags/0\.2:refs/remotes/tags/0\.2$" fetch.out &&
        grep "^tags/0\.3:refs/remotes/tags/0\.3$" fetch.out
-       grep "^:refs/remotes/git-svn" fetch.out
+       grep "^:refs/${remotes_git_svn}" fetch.out
        '
 
 test_expect_success  ".rev_db auto-converted to .rev_map.UUID" '
index 83bd1cf17a4d4e21058a31d9115cd7a37a74cbac..211baf4c2e9c8538af064d38ce65bc84d0cf6267 100755 (executable)
@@ -22,31 +22,31 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89
 bar_url=http://mayonaise/svnrepo/bar
 test_expect_success 'verify metadata for /bar' "
        git cat-file commit refs/remotes/bar | \
-          grep '^git-svn-id: $bar_url@12 $uuid$' &&
+          grep '^${git_svn_id}: $bar_url@12 $uuid$' &&
        git cat-file commit refs/remotes/bar~1 | \
-          grep '^git-svn-id: $bar_url@11 $uuid$' &&
+          grep '^${git_svn_id}: $bar_url@11 $uuid$' &&
        git cat-file commit refs/remotes/bar~2 | \
-          grep '^git-svn-id: $bar_url@10 $uuid$' &&
+          grep '^${git_svn_id}: $bar_url@10 $uuid$' &&
        git cat-file commit refs/remotes/bar~3 | \
-          grep '^git-svn-id: $bar_url@9 $uuid$' &&
+          grep '^${git_svn_id}: $bar_url@9 $uuid$' &&
        git cat-file commit refs/remotes/bar~4 | \
-          grep '^git-svn-id: $bar_url@6 $uuid$' &&
+          grep '^${git_svn_id}: $bar_url@6 $uuid$' &&
        git cat-file commit refs/remotes/bar~5 | \
-          grep '^git-svn-id: $bar_url@1 $uuid$'
+          grep '^${git_svn_id}: $bar_url@1 $uuid$'
        "
 
 e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e
 test_expect_success 'verify metadata for /dir/a/b/c/d/e' "
        git cat-file commit refs/remotes/e | \
-          grep '^git-svn-id: $e_url@1 $uuid$'
+          grep '^${git_svn_id}: $e_url@1 $uuid$'
        "
 
 dir_url=http://mayonaise/svnrepo/dir
 test_expect_success 'verify metadata for /dir' "
        git cat-file commit refs/remotes/dir | \
-          grep '^git-svn-id: $dir_url@2 $uuid$' &&
+          grep '^${git_svn_id}: $dir_url@2 $uuid$' &&
        git cat-file commit refs/remotes/dir~1 | \
-          grep '^git-svn-id: $dir_url@1 $uuid$'
+          grep '^${git_svn_id}: $dir_url@1 $uuid$'
        "
 
 test_expect_success 'find commit based on SVN revision number' "
index c5dfd61e41dfd5e466bf163af17946215ee56a74..aab109c4de4dc6e67dc43a284896321abb4ebdab 100755 (executable)
@@ -21,31 +21,31 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89
 bar_url=http://mayonaise/svnrepo/bar
 test_expect_success 'verify metadata for /bar' "
        git cat-file commit refs/remotes/bar | \
-          grep '^git-svn-id: $bar_url@12 $uuid$' &&
+          grep '^${git_svn_id}: $bar_url@12 $uuid$' &&
        git cat-file commit refs/remotes/bar~1 | \
-          grep '^git-svn-id: $bar_url@11 $uuid$' &&
+          grep '^${git_svn_id}: $bar_url@11 $uuid$' &&
        git cat-file commit refs/remotes/bar~2 | \
-          grep '^git-svn-id: $bar_url@10 $uuid$' &&
+          grep '^${git_svn_id}: $bar_url@10 $uuid$' &&
        git cat-file commit refs/remotes/bar~3 | \
-          grep '^git-svn-id: $bar_url@9 $uuid$' &&
+          grep '^${git_svn_id}: $bar_url@9 $uuid$' &&
        git cat-file commit refs/remotes/bar~4 | \
-          grep '^git-svn-id: $bar_url@6 $uuid$' &&
+          grep '^${git_svn_id}: $bar_url@6 $uuid$' &&
        git cat-file commit refs/remotes/bar~5 | \
-          grep '^git-svn-id: $bar_url@1 $uuid$'
+          grep '^${git_svn_id}: $bar_url@1 $uuid$'
        "
 
 e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e
 test_expect_success 'verify metadata for /dir/a/b/c/d/e' "
        git cat-file commit refs/remotes/e | \
-          grep '^git-svn-id: $e_url@1 $uuid$'
+          grep '^${git_svn_id}: $e_url@1 $uuid$'
        "
 
 dir_url=http://mayonaise/svnrepo/dir
 test_expect_success 'verify metadata for /dir' "
        git cat-file commit refs/remotes/dir | \
-          grep '^git-svn-id: $dir_url@2 $uuid$' &&
+          grep '^${git_svn_id}: $dir_url@2 $uuid$' &&
        git cat-file commit refs/remotes/dir~1 | \
-          grep '^git-svn-id: $dir_url@1 $uuid$'
+          grep '^${git_svn_id}: $dir_url@1 $uuid$'
        "
 
 test_done
index 5979e133b9d5b9d85ddca31a40763ed4fb6feba3..e5de22949f06ae12d61fc0d1853afe0d2016d993 100755 (executable)
@@ -21,7 +21,7 @@ else
        test_expect_success 'test clone with percent escapes' '
                git svn clone "$svnrepo/pr%20ject" clone &&
                cd clone &&
-                       git rev-parse refs/remotes/git-svn &&
+                       git rev-parse refs/${remotes_git_svn} &&
                cd ..
        '
 fi
index c18878fad16a6565fe846cc958417fea73289dce..363c1dbfc581ca5e6f15604bc4ec7a15e6faff95 100755 (executable)
@@ -17,7 +17,7 @@ rm -rf import
 test_expect_success 'init, fetch and checkout repository' '
        git svn init --rewrite-root=http://invalid.invalid/ "$svnrepo" &&
        git svn fetch
-       git checkout -b mybranch remotes/git-svn
+       git checkout -b mybranch ${remotes_git_svn}
        '
 
 test_expect_success 'remove rev_map' '