summaryrefslogtreecommitdiff
path: root/git-cvsimport.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-02-25 08:04:03 -0800
committerJunio C Hamano <gitster@pobox.com>2013-02-25 08:04:03 -0800
commit8552e2e5905b56db9a61da94f9eaf376a6e57b89 (patch)
tree72339491fb623b522de2ac222ceb3ff13f71cc06 /git-cvsimport.perl
parentb79faa99e6c4eac658130c5b6291dc0145164293 (diff)
parent48c916285753907b71a0ef663576f01ee260095c (diff)
Merge branch 'bw/get-tz-offset-perl' into maint
* bw/get-tz-offset-perl: cvsimport: format commit timestamp ourselves without using strftime perl/Git.pm: fix get_tz_offset to properly handle DST boundary cases Move Git::SVN::get_tz to Git::get_tz_offset
Diffstat (limited to 'git-cvsimport.perl')
-rwxr-xr-xgit-cvsimport.perl5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 0a31ebd820..344f1206d1 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -26,6 +26,7 @@ use IO::Socket;
use IO::Pipe;
use POSIX qw(strftime tzset dup2 ENOENT);
use IPC::Open2;
+use Git qw(get_tz_offset);
$SIG{'PIPE'}="IGNORE";
set_timezone('UTC');
@@ -864,7 +865,9 @@ sub commit {
}
set_timezone($author_tz);
- my $commit_date = strftime("%s %z", localtime($date));
+ # $date is in the seconds since epoch format
+ my $tz_offset = get_tz_offset($date);
+ my $commit_date = "$date $tz_offset";
set_timezone('UTC');
$ENV{GIT_AUTHOR_NAME} = $author_name;
$ENV{GIT_AUTHOR_EMAIL} = $author_email;