提交 b94ead75 编写于 作者: J Junio C Hamano

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: NJunio C Hamano <gitster@pobox.com>
Acked-by: NEric Wong <normalperson@yhbt.net>
上级 df5d10a3
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册