Skip to content

Commit

Permalink
Merge branch 'maint' of git://repo.or.cz/git/fastimport into maint
Browse files Browse the repository at this point in the history
* 'maint' of git://repo.or.cz/git/fastimport:
  Teach import-tars about GNU tar's @LongLink extension.
  • Loading branch information
Junio C Hamano committed May 2, 2007
2 parents a7da9ad + 775477a commit 7a33b0b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions contrib/fast-import/import-tars.perl
Expand Up @@ -52,6 +52,25 @@
Z8 Z1 Z100 Z6
Z2 Z32 Z32 Z8 Z8 Z*', $_;
last unless $name;
if ($name eq '././@LongLink') {
# GNU tar extension
if (read(I, $_, 512) != 512) {
die ('Short archive');
}
$name = unpack 'Z257', $_;
next unless $name;

my $dummy;
if (read(I, $_, 512) != 512) {
die ('Short archive');
}
($dummy, $mode, $uid, $gid, $size, $mtime,
$chksum, $typeflag, $linkname, $magic,
$version, $uname, $gname, $devmajor, $devminor,
$prefix) = unpack 'Z100 Z8 Z8 Z8 Z12 Z12
Z8 Z1 Z100 Z6
Z2 Z32 Z32 Z8 Z8 Z*', $_;
}
next if $name =~ m{/\z};
$mode = oct $mode;
$size = oct $size;
Expand Down

0 comments on commit 7a33b0b

Please sign in to comment.