Skip to content

Commit

Permalink
git-svn: fix parsing of timestamp obtained from svn
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Feb 18, 2009
1 parent df5d10a commit b94ead7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit b94ead7

Please sign in to comment.