Merge branch 'js/import-tars-hardlinks' into maint
"import-tars" fast-import script (in contrib/) used to ignore a hardlink target and replaced it with an empty file, which has been corrected to record the same blob as the other file the hardlink is shared with. * js/import-tars-hardlinks: import-tars: support hard links
This commit is contained in:
@ -96,9 +96,11 @@ foreach my $tar_file (@ARGV)
|
|||||||
$mtime = oct $mtime;
|
$mtime = oct $mtime;
|
||||||
next if $typeflag == 5; # directory
|
next if $typeflag == 5; # directory
|
||||||
|
|
||||||
|
if ($typeflag != 1) { # handle hard links later
|
||||||
print FI "blob\n", "mark :$next_mark\n";
|
print FI "blob\n", "mark :$next_mark\n";
|
||||||
if ($typeflag == 2) { # symbolic link
|
if ($typeflag == 2) { # symbolic link
|
||||||
print FI "data ", length($linkname), "\n", $linkname;
|
print FI "data ", length($linkname), "\n",
|
||||||
|
$linkname;
|
||||||
$mode = 0120000;
|
$mode = 0120000;
|
||||||
} else {
|
} else {
|
||||||
print FI "data $size\n";
|
print FI "data $size\n";
|
||||||
@ -108,6 +110,7 @@ foreach my $tar_file (@ARGV)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print FI "\n";
|
print FI "\n";
|
||||||
|
}
|
||||||
|
|
||||||
my $path;
|
my $path;
|
||||||
if ($prefix) {
|
if ($prefix) {
|
||||||
@ -115,7 +118,13 @@ foreach my $tar_file (@ARGV)
|
|||||||
} else {
|
} else {
|
||||||
$path = "$name";
|
$path = "$name";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($typeflag == 1) { # hard link
|
||||||
|
$linkname = "$prefix/$linkname" if $prefix;
|
||||||
|
$files{$path} = [ $files{$linkname}->[0], $mode ];
|
||||||
|
} else {
|
||||||
$files{$path} = [$next_mark++, $mode];
|
$files{$path} = [$next_mark++, $mode];
|
||||||
|
}
|
||||||
|
|
||||||
$author_time = $mtime if $mtime > $author_time;
|
$author_time = $mtime if $mtime > $author_time;
|
||||||
$path =~ m,^([^/]+)/,;
|
$path =~ m,^([^/]+)/,;
|
||||||
|
Reference in New Issue
Block a user