git-svn: Update git-svn to use the ability to place temporary files within repository directory
This fixes git-svn within msys where Perl will provide temporary files with path such as /tmp while the git suit expects native Windows paths. Signed-off-by: Marten Svanfeldt <developer@svanfeldt.com> Acked-by: Eric Wong <normalperson@yhbt.net>
Marten Svanfeldt (dev) committed
Nov 13, 2008 at 00:38 UTC
1b3069a753e2a2a3794db9235ea79747833cad65
1 file changed
+5
-4
git-svn.perl
+5
-4
@@ -3332,11 +3332,11 @@ sub change_file_prop {
3332
3333
sub apply_textdelta {
3334
my ($self, $fb, $exp) = @_;
3335
- my $fh = Git::temp_acquire('svn_delta');
3335
+ my $fh = $::_repository->temp_acquire('svn_delta');
3336
# $fh gets auto-closed() by SVN::TxDelta::apply(),
3337
# (but $base does not,) so dup() it for reading in close_file
3338
open my $dup, '<&', $fh or croak $!;
3339
- my $base = Git::temp_acquire('git_blob');
3339
+ my $base = $::_repository->temp_acquire('git_blob');
3340
if ($fb->{blob}) {
3341
print $base 'link ' if ($fb->{mode_a} == 120000);
3342
my $size = $::_repository->cat_blob($fb->{blob}, $base);
@@ -3377,7 +3377,8 @@ sub close_file {
3377
warn "$path has mode 120000",
3378
" but is not a link\n";
3379
} else {
3380
- my $tmp_fh = Git::temp_acquire('svn_hash');
3380
+ my $tmp_fh = $::_repository->temp_acquire(
3381
+ 'svn_hash');
3382
my $res;
3383
while ($res = sysread($fh, my $str, 1024)) {
3384
my $out = syswrite($tmp_fh, $str, $res);
@@ -3765,7 +3766,7 @@ sub change_file_prop {
3766
3767
sub _chg_file_get_blob ($$$$) {
3768
my ($self, $fbat, $m, $which) = @_;
3768
- my $fh = Git::temp_acquire("git_blob_$which");
3769
+ my $fh = $::_repository->temp_acquire("git_blob_$which");
3770
if ($m->{"mode_$which"} =~ /^120/) {
3771
print $fh 'link ' or croak $!;
3772
$self->change_file_prop($fbat,'svn:special','*');