@matheusbsbs / matheus-bagliano / commits / c53d696bcc
Fork 0

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>

Eric Wong committed Dec 12, 2006 at 16:45 UTC c53d696bcc2894b0df277e617740b15bac794df9
1 file changed +9 -1
git-svn.perl
+9 -1
@@ -2027,9 +2027,17 @@ sub git_commit {
2027
2028 # just in case we clobber the existing ref, we still want that ref
2029 # 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;
2036 push @tmp_parents, $cur;
2037 }
2038 + open STDERR, '>&', $stderr or croak $!;
2039 + close $stderr or croak $!;
2040 + close $null or croak $!;
2041
2042 if (exists $tree_map{$tree}) {
2043 foreach my $p (@{$tree_map{$tree}}) {