Merge branch 'ew/svn-maint-fixes' into maint
authorJunio C Hamano <gitster@pobox.com>
Fri, 6 Mar 2015 22:57:55 +0000 (14:57 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Mar 2015 22:57:55 +0000 (14:57 -0800)
Correct a breakage to git-svn around v2.2 era that triggers
premature closing of FileHandle.

* ew/svn-maint-fixes:
Git::SVN::*: avoid premature FileHandle closure
git-svn: fix localtime=true on non-glibc environments

1  2 
perl/Git/SVN.pm
diff --combined perl/Git/SVN.pm
index 8e4af7153eb8a8957bd4172e0c044c1bfc748ddb,7006219c0a386f59030f6a08810abfeb211a0da2..f24372645b40f81faf75e735e402a1f4c400b2ed
@@@ -14,6 -14,7 +14,7 @@@ use IPC::Open3
  use Memoize;  # core since 5.8.0, Jul 2002
  use Memoize::Storable;
  use POSIX qw(:signal_h);
+ use Time::Local;
  
  use Git qw(
      command
@@@ -1332,7 -1333,7 +1333,7 @@@ sub parse_svn_date 
                $ENV{TZ} = 'UTC';
  
                my $epoch_in_UTC =
-                   POSIX::strftime('%s', $S, $M, $H, $d, $m - 1, $Y - 1900);
+                   Time::Local::timelocal($S, $M, $H, $d, $m - 1, $Y - 1900);
  
                # Determine our local timezone (including DST) at the
                # time of $epoch_in_UTC.  $Git::SVN::Log::TZ stored the
@@@ -2365,7 -2366,7 +2366,7 @@@ sub _new 
  
        # Older repos imported by us used $GIT_DIR/svn/foo instead of
        # $GIT_DIR/svn/refs/remotes/foo when tracking refs/remotes/foo
 -      if ($ref_id =~ m{^refs/remotes/(.*)}) {
 +      if ($ref_id =~ m{^refs/remotes/(.+)}) {
                my $old_dir = "$ENV{GIT_DIR}/svn/$1";
                if (-d $old_dir && ! -d $dir) {
                        $dir = $old_dir;