From 48679e5c2d059b9b198d6f414dd80aa921d23002 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 27 Feb 2009 19:40:16 -0800 Subject: [PATCH] git-svn: disable broken symlink workaround by default Even though this will break things for some extremely rare repositories used by broken Windows clients, it's probably not worth enabling this by default as it has negatively affected many more users than it has helped from what we've seen so far. The extremely rare repositories that have broken symlinks in them will be silently corrupted in import; but users can still reenable this option and restart the import. Signed-off-by: Eric Wong Signed-off-by: Junio C Hamano --- git-svn.perl | 2 +- t/t9131-git-svn-empty-symlink.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/git-svn.perl b/git-svn.perl index d967594ee..a676a4c78 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -3297,7 +3297,7 @@ sub new { sub _mark_empty_symlinks { my ($git_svn, $switch_path) = @_; my $bool = Git::config_bool('svn.brokenSymlinkWorkaround'); - return {} if (defined($bool) && ! $bool); + return {} if (!defined($bool)) || (defined($bool) && ! $bool); my %ret; my ($rev, $cmt) = $git_svn->last_rev_commit; diff --git a/t/t9131-git-svn-empty-symlink.sh b/t/t9131-git-svn-empty-symlink.sh index 20529a878..8f35e294a 100755 --- a/t/t9131-git-svn-empty-symlink.sh +++ b/t/t9131-git-svn-empty-symlink.sh @@ -83,6 +83,8 @@ EOF ' test_expect_success 'clone using git svn' 'git svn clone -r1 "$svnrepo" x' +test_expect_success 'enable broken symlink workaround' \ + '(cd x && git config svn.brokenSymlinkWorkaround true)' test_expect_success '"bar" is an empty file' 'test -f x/bar && ! test -s x/bar' test_expect_success 'get "bar" => symlink fix from svn' \ '(cd x && git svn rebase)' @@ -97,4 +99,12 @@ test_expect_success 'get "bar" => symlink fix from svn' \ '(cd y && git svn rebase)' test_expect_success '"bar" does not become a symlink' '! test -L y/bar' +# svn.brokenSymlinkWorkaround is unset +test_expect_success 'clone using git svn' 'git svn clone -r1 "$svnrepo" z' +test_expect_success '"bar" is an empty file' 'test -f z/bar && ! test -s z/bar' +test_expect_success 'get "bar" => symlink fix from svn' \ + '(cd z && git svn rebase)' +test_expect_success '"bar" does not become a symlink' '! test -L z/bar' + + test_done -- 2.30.2