Skip to content

Commit b94ead7

Browse files
committed
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>
1 parent df5d10a commit b94ead7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-svn.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2526,7 +2526,7 @@ sub get_untracked {
25262526
sub parse_svn_date {
25272527
my $date = shift || return '+0000 1970-01-01 00:00:00';
25282528
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
25302530
croak "Unable to parse date: $date\n";
25312531
my $parsed_date; # Set next.
25322532

0 commit comments

Comments
 (0)