Skip to content

Commit 1b3069a

Browse files
theboltEric Wong
authored andcommitted
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 <[email protected]> Acked-by: Eric Wong <[email protected]>
1 parent bcdd1b4 commit 1b3069a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

git-svn.perl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3332,11 +3332,11 @@ sub change_file_prop {
33323332

33333333
sub apply_textdelta {
33343334
my ($self, $fb, $exp) = @_;
3335-
my $fh = Git::temp_acquire('svn_delta');
3335+
my $fh = $::_repository->temp_acquire('svn_delta');
33363336
# $fh gets auto-closed() by SVN::TxDelta::apply(),
33373337
# (but $base does not,) so dup() it for reading in close_file
33383338
open my $dup, '<&', $fh or croak $!;
3339-
my $base = Git::temp_acquire('git_blob');
3339+
my $base = $::_repository->temp_acquire('git_blob');
33403340
if ($fb->{blob}) {
33413341
print $base 'link ' if ($fb->{mode_a} == 120000);
33423342
my $size = $::_repository->cat_blob($fb->{blob}, $base);
@@ -3377,7 +3377,8 @@ sub close_file {
33773377
warn "$path has mode 120000",
33783378
" but is not a link\n";
33793379
} else {
3380-
my $tmp_fh = Git::temp_acquire('svn_hash');
3380+
my $tmp_fh = $::_repository->temp_acquire(
3381+
'svn_hash');
33813382
my $res;
33823383
while ($res = sysread($fh, my $str, 1024)) {
33833384
my $out = syswrite($tmp_fh, $str, $res);
@@ -3765,7 +3766,7 @@ sub change_file_prop {
37653766

37663767
sub _chg_file_get_blob ($$$$) {
37673768
my ($self, $fbat, $m, $which) = @_;
3768-
my $fh = Git::temp_acquire("git_blob_$which");
3769+
my $fh = $::_repository->temp_acquire("git_blob_$which");
37693770
if ($m->{"mode_$which"} =~ /^120/) {
37703771
print $fh 'link ' or croak $!;
37713772
$self->change_file_prop($fbat,'svn:special','*');

0 commit comments

Comments
 (0)