summaryrefslogtreecommitdiff
path: root/t/t9100-git-svn-basic.sh
diff options
context:
space:
mode:
authorDeskin Miller <deskinm@umich.edu>2008-11-06 00:07:39 -0500
committerEric Wong <normalperson@yhbt.net>2008-11-06 01:39:41 -0800
commit6e5121f26e95af02d2bbd6a982e44f16e74a67ce (patch)
treef945fed09aee92123cf4153be698e66004a3d0ec /t/t9100-git-svn-basic.sh
parentaab57205515d9a74fe20cd51c509f65757b97a66 (diff)
downloadgit-6e5121f26e95af02d2bbd6a982e44f16e74a67ce.tar.gz
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 <deskinm@umich.edu> Acked-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 't/t9100-git-svn-basic.sh')
-rwxr-xr-xt/t9100-git-svn-basic.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh
index 9b238c329b..bb921af56a 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