Skip to content

Commit

Permalink
git-svn: correctly handle packed-refs in refs/remotes/
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Wong authored and Junio C Hamano committed Dec 13, 2006
1 parent fa2376f commit c53d696
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -2027,9 +2027,17 @@ sub git_commit {

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

if (exists $tree_map{$tree}) {
foreach my $p (@{$tree_map{$tree}}) {
Expand Down

0 comments on commit c53d696

Please sign in to comment.