@matheusbsbs / matheus-bagliano / commits / b94ead7594
Fork 0

git-svn: fix parsing of timestamp obtained from svn

Ward Wouts reports that git-svn barfed like this: Unable to parse date: 2004-03-09T09:44:33.Z at /usr/bin/git-svn line 3995 The parse_svn_date sub expects there always are one or more digits after the decimal point to record fractional seconds, but this example does not and results in a failure like this. The fix is based on the original fix by the reporter, further cleaned up. Signed-off-by: Junio C Hamano <gitster@pobox.com> Acked-by: Eric Wong <normalperson@yhbt.net>

Junio C Hamano committed Feb 18, 2009 at 10:48 UTC b94ead75945fe7dbe8fbfeb48070a6b54d02e318
1 file changed +1 -1
git-svn.perl
+1 -1
@@ -2526,7 +2526,7 @@ sub get_untracked {
2526 sub parse_svn_date {
2527 my $date = shift || return '+0000 1970-01-01 00:00:00';
2528 my ($Y,$m,$d,$H,$M,$S) = ($date =~ /^(\d{4})\-(\d\d)\-(\d\d)T
2529 - (\d\d)\:(\d\d)\:(\d\d).\d+Z$/x) or
2529 + (\d\d)\:(\d\d)\:(\d\d)\.\d*Z$/x) or
2530 croak "Unable to parse date: $date\n";
2531 my $parsed_date; # Set next.
2532