From 6e5121f26e95af02d2bbd6a982e44f16e74a67ce Mon Sep 17 00:00:00 2001 From: Deskin Miller Date: Thu, 6 Nov 2008 00:07:39 -0500 Subject: git-svn: proper detection of bare repositories When in a bare repository (or .git, for that matter), git-svn would fail to initialise properly, since git rev-parse --show-cdup would not output anything. However, git rev-parse --show-cdup actually returns an error code if it's really not in a git directory. Fix the issue by checking for an explicit error from git rev-parse, and setting $git_dir appropriately if instead it just does not output. Signed-off-by: Deskin Miller Acked-by: Eric Wong --- t/t9100-git-svn-basic.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 't/t9100-git-svn-basic.sh') diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh index 9b238c329..bb921af56 100755 --- a/t/t9100-git-svn-basic.sh +++ b/t/t9100-git-svn-basic.sh @@ -265,4 +265,13 @@ test_expect_success 'able to set-tree to a subdirectory' " test -z \"\`git diff refs/heads/my-bar refs/remotes/bar\`\" " +test_expect_success 'git-svn works in a bare repository' ' + mkdir bare-repo && + ( cd bare-repo && + git init --bare && + GIT_DIR=. git svn init "$svnrepo" && + git svn fetch ) && + rm -rf bare-repo + ' + test_done -- cgit v1.2.1