Skip to content

Commit

Permalink
git-svn - return original format_svn_date semantics
Browse files Browse the repository at this point in the history
When %z was removed from the strftime call and subsituted with a
local gmt offset calculation, time() was no longer the default for
all time functions as it was with the previous localtime(shift).
This is now corrected so that format_svn_time behaves as it used to.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ben Walton authored and Junio C Hamano committed Feb 28, 2009
1 parent 48679e5 commit 736e619
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 @@ -4738,7 +4738,7 @@ sub run_pager {

sub format_svn_date {
# some systmes don't handle or mishandle %z, so be creative.
my $t = shift;
my $t = shift || time;
my $gm = timelocal(gmtime($t));
my $sign = qw( + + - )[ $t <=> $gm ];
my $gmoff = sprintf("%s%02d%02d", $sign, (gmtime(abs($t - $gm)))[2,1]);
Expand Down

0 comments on commit 736e619

Please sign in to comment.