Skip to content

Commit

Permalink
git-svnimport symlink support
Browse files Browse the repository at this point in the history
added svn:special symlink support for access methods other than
direct-http

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Acked-by: Matthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Herbert Valerio Riedel authored and Junio C Hamano committed Apr 18, 2006
1 parent 2855d58 commit 08ddd4f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions git-svnimport.perl
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ package SVNconn;
use File::Spec;
use File::Temp qw(tempfile);
use POSIX qw(strftime dup2);
use Fcntl qw(SEEK_SET);

sub new {
my($what,$repo) = @_;
Expand Down Expand Up @@ -143,9 +144,22 @@ sub file {
}
my $mode;
if (exists $properties->{'svn:executable'}) {
$mode = '0755';
$mode = '100755';
} elsif (exists $properties->{'svn:special'}) {
my ($special_content, $filesize);
$filesize = tell $fh;
seek $fh, 0, SEEK_SET;
read $fh, $special_content, $filesize;
if ($special_content =~ s/^link //) {
$mode = '120000';
seek $fh, 0, SEEK_SET;
truncate $fh, 0;
print $fh $special_content;
} else {
die "unexpected svn:special file encountered";
}
} else {
$mode = '0644';
$mode = '100644';
}
close ($fh);

Expand Down

0 comments on commit 08ddd4f

Please sign in to comment.