summaryrefslogtreecommitdiff
path: root/perl/Git/SVN.pm
diff options
context:
space:
mode:
authorLibravatar Ben Walton <bdwalton@gmail.com>2013-02-09 21:46:56 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-02-09 14:01:28 -0800
commit68868ff57348b7ae351890b3599949422d2e6001 (patch)
tree78b31a635b9a118c9e207f41e2dc2ef680ae109c /perl/Git/SVN.pm
parentGit 1.8.1.3 (diff)
downloadtgif-68868ff57348b7ae351890b3599949422d2e6001.tar.xz
Move Git::SVN::get_tz to Git::get_tz_offset
This function has utility outside of the SVN module for any routine that needs the equivalent of GNU strftime's %z formatting option. Move it to the top-level Git.pm so that non-SVN modules don't need to import the SVN module to use it. The rename makes the purpose of the function clearer. Signed-off-by: Ben Walton <bdwalton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'perl/Git/SVN.pm')
-rw-r--r--perl/Git/SVN.pm12
1 files changed, 2 insertions, 10 deletions
diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
index 59215fa86e..8c84560a49 100644
--- a/perl/Git/SVN.pm
+++ b/perl/Git/SVN.pm
@@ -11,7 +11,6 @@ use Carp qw/croak/;
use File::Path qw/mkpath/;
use File::Copy qw/copy/;
use IPC::Open3;
-use Time::Local;
use Memoize; # core since 5.8.0, Jul 2002
use Memoize::Storable;
use POSIX qw(:signal_h);
@@ -22,6 +21,7 @@ use Git qw(
command_noisy
command_output_pipe
command_close_pipe
+ get_tz_offset
);
use Git::SVN::Utils qw(
fatal
@@ -1311,14 +1311,6 @@ sub get_untracked {
\@out;
}
-sub get_tz {
- # some systmes don't handle or mishandle %z, so be creative.
- my $t = shift || time;
- my $gm = timelocal(gmtime($t));
- my $sign = qw( + + - )[ $t <=> $gm ];
- return sprintf("%s%02d%02d", $sign, (gmtime(abs($t - $gm)))[2,1]);
-}
-
# parse_svn_date(DATE)
# --------------------
# Given a date (in UTC) from Subversion, return a string in the format
@@ -1351,7 +1343,7 @@ sub parse_svn_date {
delete $ENV{TZ};
}
- my $our_TZ = get_tz();
+ my $our_TZ = get_tz_offset();
# This converts $epoch_in_UTC into our local timezone.
my ($sec, $min, $hour, $mday, $mon, $year,