Skip to content

Commit

Permalink
git-svn: disable broken symlink workaround by default
Browse files Browse the repository at this point in the history
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 <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Eric Wong authored and Junio C Hamano committed Feb 28, 2009
1 parent 48fce93 commit 48679e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions t/t9131-git-svn-empty-symlink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
Expand All @@ -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

0 comments on commit 48679e5

Please sign in to comment.