import-tars: Use the "Link indicator" to identify directories
Earlier, we used the mode to determine if a name was associated with a directory. This fails, since some tar programs do not set the mode correctly. However, the link indicator _has_ to be set correctly. Noticed by Chris Riddoch. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Acked-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Johannes Schindelin committed
May 16, 2007 at 17:22 UTC
df8cfac815a1fae75afd20a86beb194d9d947971
1 file changed
+1
-1
contrib/fast-import/import-tars.perl
+1
-1
@@ -75,7 +75,7 @@ foreach my $tar_file (@ARGV)
75
$mode = oct $mode;
76
$size = oct $size;
77
$mtime = oct $mtime;
78
- next if $mode & 0040000;
78
+ next if $typeflag == 5; # directory
79
80
print FI "blob\n", "mark :$next_mark\n", "data $size\n";
81
while ($size > 0 && read(I, $_, 512) == 512) {