Skip to content

Commit 48679e5

Browse files
Eric Wonggitster
authored andcommitted
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 <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 48fce93 commit 48679e5

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

git-svn.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3297,7 +3297,7 @@ sub new {
32973297
sub _mark_empty_symlinks {
32983298
my ($git_svn, $switch_path) = @_;
32993299
my $bool = Git::config_bool('svn.brokenSymlinkWorkaround');
3300-
return {} if (defined($bool) && ! $bool);
3300+
return {} if (!defined($bool)) || (defined($bool) && ! $bool);
33013301

33023302
my %ret;
33033303
my ($rev, $cmt) = $git_svn->last_rev_commit;

t/t9131-git-svn-empty-symlink.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ EOF
8383
'
8484

8585
test_expect_success 'clone using git svn' 'git svn clone -r1 "$svnrepo" x'
86+
test_expect_success 'enable broken symlink workaround' \
87+
'(cd x && git config svn.brokenSymlinkWorkaround true)'
8688
test_expect_success '"bar" is an empty file' 'test -f x/bar && ! test -s x/bar'
8789
test_expect_success 'get "bar" => symlink fix from svn' \
8890
'(cd x && git svn rebase)'
@@ -97,4 +99,12 @@ test_expect_success 'get "bar" => symlink fix from svn' \
9799
'(cd y && git svn rebase)'
98100
test_expect_success '"bar" does not become a symlink' '! test -L y/bar'
99101

102+
# svn.brokenSymlinkWorkaround is unset
103+
test_expect_success 'clone using git svn' 'git svn clone -r1 "$svnrepo" z'
104+
test_expect_success '"bar" is an empty file' 'test -f z/bar && ! test -s z/bar'
105+
test_expect_success 'get "bar" => symlink fix from svn' \
106+
'(cd z && git svn rebase)'
107+
test_expect_success '"bar" does not become a symlink' '! test -L z/bar'
108+
109+
100110
test_done

0 commit comments

Comments
 (0)