summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-06-18 17:39:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-06-18 17:39:17 (GMT)
commitda4e4a65a27ca912c3f48289acf9ff7a67476c3f (patch)
treef8523544be8420fd7da3c440d7ff66220f46307f /contrib
parentd978ead4c3933425f54142f2c3fab7f5071e36ef (diff)
parentef52aafa0f8b1d34f2ecd9b58f2198711c87cab3 (diff)
downloadgit-da4e4a65a27ca912c3f48289acf9ff7a67476c3f.zip
git-da4e4a65a27ca912c3f48289acf9ff7a67476c3f.tar.gz
git-da4e4a65a27ca912c3f48289acf9ff7a67476c3f.tar.bz2
Merge branch 'maint'
* maint: http.c: fix compiling with libcurl 7.9.2 import-tars: support symlinks pull, rebase: simplify to use die()
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/import-tars.perl17
1 files changed, 12 insertions, 5 deletions
diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl
index 6309d14..78e40d2 100755
--- a/contrib/fast-import/import-tars.perl
+++ b/contrib/fast-import/import-tars.perl
@@ -82,10 +82,16 @@ foreach my $tar_file (@ARGV)
$mtime = oct $mtime;
next if $typeflag == 5; # directory
- print FI "blob\n", "mark :$next_mark\n", "data $size\n";
- while ($size > 0 && read(I, $_, 512) == 512) {
- print FI substr($_, 0, $size);
- $size -= 512;
+ print FI "blob\n", "mark :$next_mark\n";
+ if ($typeflag == 2) { # symbolic link
+ print FI "data ", length($linkname), "\n", $linkname;
+ $mode = 0120000;
+ } else {
+ print FI "data $size\n";
+ while ($size > 0 && read(I, $_, 512) == 512) {
+ print FI substr($_, 0, $size);
+ $size -= 512;
+ }
}
print FI "\n";
@@ -118,7 +124,8 @@ EOF
{
my ($mark, $mode) = @{$files{$path}};
$path =~ s,^([^/]+)/,, if $have_top_dir;
- printf FI "M %o :%i %s\n", $mode & 0111 ? 0755 : 0644, $mark, $path;
+ $mode = $mode & 0111 ? 0755 : 0644 unless $mode == 0120000;
+ printf FI "M %o :%i %s\n", $mode, $mark, $path;
}
print FI "\n";