blob: allow lookup_blob to handle arbitrary repositories
[gitweb.git] / git-cvsimport.perl
index 36929921ea79006dc659f6996ae158131ccf2b73..b31613cb8aa8decd3f808d5d29e047243fa1eac6 100755 (executable)
@@ -601,7 +601,9 @@ ($)
        my ($d) = @_;
        m#(\d{2,4})/(\d\d)/(\d\d)\s(\d\d):(\d\d)(?::(\d\d))?#
                or die "Unparseable date: $d\n";
-       my $y=$1; $y-=1900 if $y>1900;
+       my $y=$1;
+       $y+=100 if $y<70;
+       $y+=1900 if $y<1000;
        return timegm($6||0,$5,$4,$3,$2-1,$y);
 }
 
@@ -642,7 +644,7 @@ sub is_sha1 {
 
 sub get_headref ($) {
        my $name = shift;
-       $name =~ s/'/'\\''/;
+       $name =~ s/'/'\\''/g;
        my $r = `git rev-parse --verify '$name' 2>/dev/null`;
        return undef unless $? == 0;
        chomp $r;