From: Junio C Hamano Date: Wed, 18 Feb 2009 18:48:01 +0000 (-0800) Subject: git-svn: fix parsing of timestamp obtained from svn X-Git-Tag: v1.6.2-rc2~25 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b94ead75945fe7dbe8fbfeb48070a6b54d02e318;p=git.git 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 Acked-by: Eric Wong --- diff --git a/git-svn.perl b/git-svn.perl index 83cb36f06..cbc5211d5 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -2526,7 +2526,7 @@ sub get_untracked { sub parse_svn_date { my $date = shift || return '+0000 1970-01-01 00:00:00'; my ($Y,$m,$d,$H,$M,$S) = ($date =~ /^(\d{4})\-(\d\d)\-(\d\d)T - (\d\d)\:(\d\d)\:(\d\d).\d+Z$/x) or + (\d\d)\:(\d\d)\:(\d\d)\.\d*Z$/x) or croak "Unable to parse date: $date\n"; my $parsed_date; # Set next.