Skip to content

Commit

Permalink
import-tars: Use the "Link indicator" to identify directories
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Shawn O. Pearce committed May 16, 2007
1 parent 52e7b74 commit df8cfac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/fast-import/import-tars.perl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
$mode = oct $mode;
$size = oct $size;
$mtime = oct $mtime;
next if $mode & 0040000;
next if $typeflag == 5; # directory

print FI "blob\n", "mark :$next_mark\n", "data $size\n";
while ($size > 0 && read(I, $_, 512) == 512) {
Expand Down

0 comments on commit df8cfac

Please sign in to comment.