diff options
author | 2008-11-06 00:07:39 -0500 | |
---|---|---|
committer | 2008-11-13 22:33:59 -0800 | |
commit | fe4003f6308b88bcc44a989f12e1baddd97f22d4 (patch) | |
tree | fa76d099401455c6ea3ed146fccc24a5eb461948 /t/t9100-git-svn-basic.sh | |
parent | git-svn: respect i18n.commitencoding config (diff) | |
download | tgif-fe4003f6308b88bcc44a989f12e1baddd97f22d4.tar.xz |
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-x | t/t9100-git-svn-basic.sh | 9 |
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 |