diff options
Diffstat (limited to 't/t9100-git-svn-basic.sh')
| -rwxr-xr-x | t/t9100-git-svn-basic.sh | 67 | 
1 files changed, 49 insertions, 18 deletions
| diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh index 4eee2e9fa6..2f458f7a99 100755 --- a/t/t9100-git-svn-basic.sh +++ b/t/t9100-git-svn-basic.sh @@ -15,24 +15,25 @@ case "$GIT_SVN_LC_ALL" in  	test_set_prereq UTF8  	;;  *) -	say "UTF-8 locale not set, some tests skipped ($GIT_SVN_LC_ALL)" +	say "# UTF-8 locale not set, some tests skipped ($GIT_SVN_LC_ALL)"  	;;  esac  test_expect_success \      'initialize git svn' '  	mkdir import && -	cd import && -	echo foo > foo && -	ln -s foo foo.link -	mkdir -p dir/a/b/c/d/e && -	echo "deep dir" > dir/a/b/c/d/e/file && -	mkdir bar && -	echo "zzz" > bar/zzz && -	echo "#!/bin/sh" > exec.sh && -	chmod +x exec.sh && -	svn import -m "import for git svn" . "$svnrepo" >/dev/null && -	cd .. && +	( +		cd import && +		echo foo >foo && +		ln -s foo foo.link +		mkdir -p dir/a/b/c/d/e && +		echo "deep dir" >dir/a/b/c/d/e/file && +		mkdir bar && +		echo "zzz" >bar/zzz && +		echo "#!/bin/sh" >exec.sh && +		chmod +x exec.sh && +		svn_cmd import -m "import for git svn" . "$svnrepo" >/dev/null +	) &&  	rm -rf import &&  	git svn init "$svnrepo"' @@ -51,7 +52,7 @@ test_expect_success "$name" '  	git commit -m "$name" &&  	git svn set-tree --find-copies-harder --rmdir \  		${remotes_git_svn}..mybranch && -	svn up "$SVN_TREE" && +	svn_cmd up "$SVN_TREE" &&  	test -d "$SVN_TREE"/dir && test ! -d "$SVN_TREE"/dir/a' @@ -118,7 +119,7 @@ test_expect_success "$name" '  	git commit -m "$name" &&  	git svn set-tree --find-copies-harder --rmdir \  		${remotes_git_svn}..mybranch5 && -	svn up "$SVN_TREE" && +	svn_cmd up "$SVN_TREE" &&  	test ! -x "$SVN_TREE"/exec.sh' @@ -129,7 +130,7 @@ test_expect_success "$name" '  	git commit -m "$name" &&  	git svn set-tree --find-copies-harder --rmdir \  		${remotes_git_svn}..mybranch5 && -	svn up "$SVN_TREE" && +	svn_cmd up "$SVN_TREE" &&  	test -x "$SVN_TREE"/exec.sh' @@ -141,7 +142,7 @@ test_expect_success "$name" '  	git commit -m "$name" &&  	git svn set-tree --find-copies-harder --rmdir \  		${remotes_git_svn}..mybranch5 && -	svn up "$SVN_TREE" && +	svn_cmd up "$SVN_TREE" &&  	test -L "$SVN_TREE"/exec.sh'  name='new symlink is added to a file that was also just made executable' @@ -153,7 +154,7 @@ test_expect_success "$name" '  	git commit -m "$name" &&  	git svn set-tree --find-copies-harder --rmdir \  		${remotes_git_svn}..mybranch5 && -	svn up "$SVN_TREE" && +	svn_cmd up "$SVN_TREE" &&  	test -x "$SVN_TREE"/bar/zzz &&  	test -L "$SVN_TREE"/exec-2.sh' @@ -166,7 +167,7 @@ test_expect_success "$name" '  	git commit -m "$name" &&  	git svn set-tree --find-copies-harder --rmdir \  		${remotes_git_svn}..mybranch5 && -	svn up "$SVN_TREE" && +	svn_cmd up "$SVN_TREE" &&  	test -f "$SVN_TREE"/exec-2.sh &&  	test ! -L "$SVN_TREE"/exec-2.sh &&  	test_cmp help "$SVN_TREE"/exec-2.sh' @@ -231,6 +232,25 @@ test_expect_success \                                "^:refs/${remotes_git_svn}$"          ' +test_expect_success 'dcommit $rev does not clobber current branch' ' +	git svn fetch -i bar && +	git checkout -b my-bar refs/remotes/bar && +	echo 1 > foo && +	git add foo && +	git commit -m "change 1" && +	echo 2 > foo && +	git add foo && +	git commit -m "change 2" && +	old_head=$(git rev-parse HEAD) && +	git svn dcommit -i bar HEAD^ && +	test $old_head = $(git rev-parse HEAD) && +	test refs/heads/my-bar = $(git symbolic-ref HEAD) && +	git log refs/remotes/bar | grep "change 1" && +	! git log refs/remotes/bar | grep "change 2" && +	git checkout master && +	git branch -D my-bar +	' +  test_expect_success 'able to dcommit to a subdirectory' "  	git svn fetch -i bar &&  	git checkout -b my-bar refs/remotes/bar && @@ -252,6 +272,17 @@ test_expect_success 'able to dcommit to a subdirectory' "  	test -z \"\`git diff refs/heads/my-bar refs/remotes/bar\`\"  	" +test_expect_success 'dcommit should not fail with a touched file' ' +	test_commit "commit-new-file-foo2" foo2 && +	test-chmtime =-60 foo && +	git svn dcommit +' + +test_expect_success 'rebase should not fail with a touched file' ' +	test-chmtime =-60 foo && +	git svn rebase +' +  test_expect_success 'able to set-tree to a subdirectory' "  	echo cba > d &&  	git update-index d && | 
