Skip to content

Commit c53d696

Browse files
Eric WongJunio C Hamano
authored andcommitted
git-svn: correctly handle packed-refs in refs/remotes/
We now use git-rev-parse universally to read refs, instead of our own file_to_s function (which I plan on removing). Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent fa2376f commit c53d696

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

git-svn.perl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2027,9 +2027,17 @@ sub git_commit {
20272027

20282028
# just in case we clobber the existing ref, we still want that ref
20292029
# as our parent:
2030-
if (my $cur = eval { file_to_s("$GIT_DIR/refs/remotes/$GIT_SVN") }) {
2030+
open my $null, '>', '/dev/null' or croak $!;
2031+
open my $stderr, '>&', \*STDERR or croak $!;
2032+
open STDERR, '>&', $null or croak $!;
2033+
if (my $cur = eval { safe_qx('git-rev-parse',
2034+
"refs/remotes/$GIT_SVN^0") }) {
2035+
chomp $cur;
20312036
push @tmp_parents, $cur;
20322037
}
2038+
open STDERR, '>&', $stderr or croak $!;
2039+
close $stderr or croak $!;
2040+
close $null or croak $!;
20332041

20342042
if (exists $tree_map{$tree}) {
20352043
foreach my $p (@{$tree_map{$tree}}) {

0 commit comments

Comments
 (0)