Code

fix importing of subversion tars
authorUwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Tue, 24 Apr 2007 11:51:04 +0000 (13:51 +0200)
committerShawn O. Pearce <spearce@spearce.org>
Tue, 24 Apr 2007 16:14:40 +0000 (12:14 -0400)
add a / between the prefix and name fields of the tar archive if prefix
is non-empty.

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
contrib/fast-import/import-tars.perl

index 5585a8b2c575f92e6154e03641b467e5e54509f4..184214689dfd3f1204546b060adbffd3f6d79bbe 100755 (executable)
@@ -64,7 +64,12 @@ foreach my $tar_file (@ARGV)
                }
                print FI "\n";
 
-               my $path = "$prefix$name";
+               my $path;
+               if ($prefix) {
+                       $path = "$prefix/$name";
+               } else {
+                       $path = "$name";
+               }
                $files{$path} = [$next_mark++, $mode];
 
                $commit_time = $mtime if $mtime > $commit_time;