summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/t0021-conversion.sh4
-rwxr-xr-xt/t1300-repo-config.sh19
-rwxr-xr-xt/t2200-add-update.sh38
-rwxr-xr-xt/t4122-apply-symlink-inside.sh56
-rwxr-xr-xt/t9100-git-svn-basic.sh2
-rwxr-xr-xt/t9104-git-svn-follow-parent.sh13
-rwxr-xr-xt/t9105-git-svn-commit-diff.sh2
-rwxr-xr-xt/t9110-git-svn-use-svm-props.sh7
-rwxr-xr-xt/t9111-git-svn-use-svnsync-props.sh6
-rwxr-xr-xt/t9400-git-cvsserver-server.sh17
10 files changed, 140 insertions, 24 deletions
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index bab9ecc34e..6c26fd829d 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -21,7 +21,7 @@ test_expect_success setup '
{
echo a b c d e f g h i j k l m
echo n o p q r s t u v w x y z
- echo '\''$ident$'\''
+ echo '\''$Id$'\''
} >test &&
cat test >test.t &&
cat test >test.o &&
@@ -31,7 +31,7 @@ test_expect_success setup '
git checkout -- test test.t test.i
'
-script='s/^\$ident: \([0-9a-f]*\) \$/\1/p'
+script='s/^\$Id: \([0-9a-f]*\) \$/\1/p'
test_expect_success check '
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 78c2e0864f..a1d777ca81 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -407,6 +407,25 @@ EOF
test_expect_success "section was removed properly" \
"git diff -u expect .git/config"
+rm .git/config
+
+cat > expect << EOF
+[gitcvs]
+ enabled = true
+ dbname = %Ggitcvs2.%a.%m.sqlite
+[gitcvs "ext"]
+ dbname = %Ggitcvs1.%a.%m.sqlite
+EOF
+
+test_expect_success 'section ending' '
+
+ git-config gitcvs.enabled true &&
+ git-config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
+ git-config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
+ cmp .git/config expect
+
+'
+
test_expect_success numbers '
git-config kilo.gram 1k &&
diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh
new file mode 100755
index 0000000000..83005e70d0
--- /dev/null
+++ b/t/t2200-add-update.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+test_description='git-add -u with path limiting
+
+This test creates a working tree state with three files:
+
+ top (previously committed, modified)
+ dir/sub (previously committed, modified)
+ dir/other (untracked)
+
+and issues a git-add -u with path limiting on "dir" to add
+only the updates to dir/sub.'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+echo initial >top &&
+mkdir dir &&
+echo initial >dir/sub &&
+git-add dir/sub top &&
+git-commit -m initial &&
+echo changed >top &&
+echo changed >dir/sub &&
+echo other >dir/other
+'
+
+test_expect_success 'update' 'git-add -u dir'
+
+test_expect_success 'update touched correct path' \
+ 'test "`git-diff-files --name-status dir/sub`" = ""'
+
+test_expect_success 'update did not touch other tracked files' \
+ 'test "`git-diff-files --name-status top`" = "M top"'
+
+test_expect_success 'update did not touch untracked files' \
+ 'test "`git-diff-files --name-status dir/other`" = ""'
+
+test_done
diff --git a/t/t4122-apply-symlink-inside.sh b/t/t4122-apply-symlink-inside.sh
new file mode 100755
index 0000000000..3ddfe64b02
--- /dev/null
+++ b/t/t4122-apply-symlink-inside.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+test_description='apply to deeper directory without getting fooled with symlink'
+. ./test-lib.sh
+
+lecho () {
+ for l_
+ do
+ echo "$l_"
+ done
+}
+
+test_expect_success setup '
+
+ mkdir -p arch/i386/boot arch/x86_64 &&
+ lecho 1 2 3 4 5 >arch/i386/boot/Makefile &&
+ ln -s ../i386/boot arch/x86_64/boot &&
+ git add . &&
+ test_tick &&
+ git commit -m initial &&
+ git branch test &&
+
+ rm arch/x86_64/boot &&
+ mkdir arch/x86_64/boot &&
+ lecho 2 3 4 5 6 >arch/x86_64/boot/Makefile &&
+ git add . &&
+ test_tick &&
+ git commit -a -m second &&
+
+ git format-patch --binary -1 --stdout >test.patch
+
+'
+
+test_expect_success apply '
+
+ git checkout test &&
+ git diff --exit-code test &&
+ git diff --exit-code --cached test &&
+ git apply --index test.patch
+
+'
+
+test_expect_success 'check result' '
+
+ git diff --exit-code master &&
+ git diff --exit-code --cached master &&
+ test_tick &&
+ git commit -m replay &&
+ T1=$(git rev-parse "master^{tree}") &&
+ T2=$(git rev-parse "HEAD^{tree}") &&
+ test "z$T1" = "z$T2"
+
+'
+
+test_done
+
diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh
index eb628fe075..70c3669ee8 100755
--- a/t/t9100-git-svn-basic.sh
+++ b/t/t9100-git-svn-basic.sh
@@ -229,7 +229,7 @@ test_expect_failure 'exit if init-ing a would clobber a URL' "
test_expect_success \
'init allows us to connect to another directory in the same repo' "
- git-svn init -i bar $svnrepo/bar &&
+ git-svn init --minimize-url -i bar $svnrepo/bar &&
git config --get svn-remote.svn.fetch \
'^bar:refs/remotes/bar$' &&
git config --get svn-remote.svn.fetch \
diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh
index bd4f366e86..35aa45cb9a 100755
--- a/t/t9104-git-svn-follow-parent.sh
+++ b/t/t9104-git-svn-follow-parent.sh
@@ -28,7 +28,7 @@ test_expect_success 'initialize repo' "
"
test_expect_success 'init and fetch a moved directory' "
- git-svn init -i thunk $svnrepo/thunk &&
+ git-svn init --minimize-url -i thunk $svnrepo/thunk &&
git-svn fetch -i thunk &&
test \"\`git-rev-parse --verify refs/remotes/thunk@2\`\" \
= \"\`git-rev-parse --verify refs/remotes/thunk~1\`\" &&
@@ -68,7 +68,8 @@ test_expect_success 'follow larger parent' "
echo hi > import/trunk/thunk/bump/thud/file &&
svn import -m 'import a larger parent' import $svnrepo/larger-parent &&
svn cp -m 'hi' $svnrepo/larger-parent $svnrepo/another-larger &&
- git-svn init -i larger $svnrepo/another-larger/trunk/thunk/bump/thud &&
+ git-svn init --minimize-url -i larger \
+ $svnrepo/another-larger/trunk/thunk/bump/thud &&
git-svn fetch -i larger &&
git-rev-parse --verify refs/remotes/larger &&
git-rev-parse --verify \
@@ -90,14 +91,14 @@ test_expect_success 'follow higher-level parent' "
cd ..
svn mkdir -m 'new glob at top level' $svnrepo/glob &&
svn mv -m 'move blob down a level' $svnrepo/blob $svnrepo/glob/blob &&
- git-svn init -i blob $svnrepo/glob/blob &&
+ git-svn init --minimize-url -i blob $svnrepo/glob/blob &&
git-svn fetch -i blob
"
test_expect_success 'follow deleted directory' "
svn mv -m 'bye!' $svnrepo/glob/blob/hi $svnrepo/glob/blob/bye &&
svn rm -m 'remove glob' $svnrepo/glob &&
- git-svn init -i glob $svnrepo/glob &&
+ git-svn init --minimize-url -i glob $svnrepo/glob &&
git-svn fetch -i glob &&
test \"\`git cat-file blob refs/remotes/glob:blob/bye\`\" = hi &&
test \"\`git ls-tree refs/remotes/glob | wc -l \`\" -eq 1
@@ -127,7 +128,7 @@ test_expect_success 'follow-parent avoids deleting relevant info' "
poke native/t/c.t &&
svn commit -m 'reorg test' &&
cd .. &&
- git-svn init -i r9270-t \
+ git-svn init --minimize-url -i r9270-t \
$svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t &&
git-svn fetch -i r9270-t &&
test \`git rev-list r9270-t | wc -l\` -eq 2 &&
@@ -137,7 +138,7 @@ test_expect_success 'follow-parent avoids deleting relevant info' "
test_expect_success "track initial change if it was only made to parent" "
svn cp -m 'wheee!' $svnrepo/r9270/trunk $svnrepo/r9270/drunk &&
- git-svn init -i r9270-d \
+ git-svn init --minimize-url -i r9270-d \
$svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t &&
git-svn fetch -i r9270-d &&
test \`git rev-list r9270-d | wc -l\` -eq 3 &&
diff --git a/t/t9105-git-svn-commit-diff.sh b/t/t9105-git-svn-commit-diff.sh
index c668dd1270..318e172ef5 100755
--- a/t/t9105-git-svn-commit-diff.sh
+++ b/t/t9105-git-svn-commit-diff.sh
@@ -33,7 +33,7 @@ test_expect_success 'test the commit-diff command' "
test_expect_success 'commit-diff to a sub-directory (with git-svn config)' "
svn import -m 'sub-directory' import $svnrepo/subdir &&
- git-svn init $svnrepo/subdir &&
+ git-svn init --minimize-url $svnrepo/subdir &&
git-svn fetch &&
git-svn commit-diff -r3 '$prev' '$head' &&
svn cat $svnrepo/subdir/readme > readme.2 &&
diff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh
index 9db0d8fd8d..59e17f2663 100755
--- a/t/t9110-git-svn-use-svm-props.sh
+++ b/t/t9110-git-svn-use-svm-props.sh
@@ -9,9 +9,10 @@ test_description='git-svn useSvmProps test'
test_expect_success 'load svm repo' "
svnadmin load -q $rawsvnrepo < ../t9110/svm.dump &&
- git-svn init -R arr -i bar $svnrepo/mirror/arr &&
- git-svn init -R argh -i dir $svnrepo/mirror/argh &&
- git-svn init -R argh -i e $svnrepo/mirror/argh/a/b/c/d/e &&
+ git-svn init --minimize-url -R arr -i bar $svnrepo/mirror/arr &&
+ git-svn init --minimize-url -R argh -i dir $svnrepo/mirror/argh &&
+ git-svn init --minimize-url -R argh -i e \
+ $svnrepo/mirror/argh/a/b/c/d/e &&
git-config svn.useSvmProps true &&
git-svn fetch --all
"
diff --git a/t/t9111-git-svn-use-svnsync-props.sh b/t/t9111-git-svn-use-svnsync-props.sh
index 483d7f8159..e52321471a 100755
--- a/t/t9111-git-svn-use-svnsync-props.sh
+++ b/t/t9111-git-svn-use-svnsync-props.sh
@@ -9,9 +9,9 @@ test_description='git-svn useSvnsyncProps test'
test_expect_success 'load svnsync repo' "
svnadmin load -q $rawsvnrepo < ../t9111/svnsync.dump &&
- git-svn init -R arr -i bar $svnrepo/bar &&
- git-svn init -R argh -i dir $svnrepo/dir &&
- git-svn init -R argh -i e $svnrepo/dir/a/b/c/d/e &&
+ git-svn init --minimize-url -R arr -i bar $svnrepo/bar &&
+ git-svn init --minimize-url -R argh -i dir $svnrepo/dir &&
+ git-svn init --minimize-url -R argh -i e $svnrepo/dir/a/b/c/d/e &&
git-config svn.useSvnsyncProps true &&
git-svn fetch --all
"
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index f137b308f3..d406a8824a 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -26,8 +26,9 @@ perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
unset GIT_DIR GIT_CONFIG
WORKDIR=$(pwd)
SERVERDIR=$(pwd)/gitcvs.git
+git_config="$SERVERDIR/config"
CVSROOT=":fork:$SERVERDIR"
-CVSWORK=$(pwd)/cvswork
+CVSWORK="$(pwd)/cvswork"
CVS_SERVER=git-cvsserver
export CVSROOT CVS_SERVER
@@ -43,7 +44,7 @@ echo >empty &&
# note that cvs doesn't accept absolute pathnames
# as argument to co -d
test_expect_success 'basic checkout' \
- 'cvs -Q co -d cvswork master &&
+ 'GIT_CONFIG="$git_config" cvs -Q co -d cvswork master &&
test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5))" = "empty/1.1/"'
test_expect_success 'cvs update (create new file)' \
@@ -52,7 +53,7 @@ test_expect_success 'cvs update (create new file)' \
git commit -q -m "Add testfile1" &&
git push gitcvs.git >/dev/null &&
cd cvswork &&
- cvs -Q update &&
+ GIT_CONFIG="$git_config" cvs -Q update &&
test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" &&
diff -q testfile1 ../testfile1'
@@ -63,7 +64,7 @@ test_expect_success 'cvs update (update existing file)' \
git commit -q -m "Append to testfile1" &&
git push gitcvs.git >/dev/null &&
cd cvswork &&
- cvs -Q update &&
+ GIT_CONFIG="$git_config" cvs -Q update &&
test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" &&
diff -q testfile1 ../testfile1'
@@ -76,7 +77,7 @@ test_expect_failure "cvs update w/o -d doesn't create subdir (TODO)" \
git commit -q -m "Single Subdirectory" &&
git push gitcvs.git >/dev/null &&
cd cvswork &&
- cvs -Q update &&
+ GIT_CONFIG="$git_config" cvs -Q update &&
test ! -d test'
cd "$WORKDIR"
@@ -89,7 +90,7 @@ test_expect_success 'cvs update (subdirectories)' \
git commit -q -m "deep sub directory structure" &&
git push gitcvs.git >/dev/null &&
cd cvswork &&
- cvs -Q update -d &&
+ GIT_CONFIG="$git_config" cvs -Q update -d &&
(for dir in A A/B A/B/C A/D E; do
filename="file_in_$(echo $dir|sed -e "s#/# #g")" &&
if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" &&
@@ -107,7 +108,7 @@ test_expect_success 'cvs update (delete file)' \
git commit -q -m "Remove testfile1" &&
git push gitcvs.git >/dev/null &&
cd cvswork &&
- cvs -Q update &&
+ GIT_CONFIG="$git_config" cvs -Q update &&
test -z "$(grep testfile1 CVS/Entries)" &&
test ! -f testfile1'
@@ -118,7 +119,7 @@ test_expect_success 'cvs update (re-add deleted file)' \
git commit -q -m "Re-Add testfile1" &&
git push gitcvs.git >/dev/null &&
cd cvswork &&
- cvs -Q update &&
+ GIT_CONFIG="$git_config" cvs -Q update &&
test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" &&
diff -q testfile1 ../testfile1'