[PATCH 4/3] git-svn: correctly handle packed-refs in refs/remotes/
- From
- Eric Wong <normalperson@yhbt.net>
- Date
- Dec 13, 2006, 00:45 UTC
- Message-ID
- <20061213004500.GA17811@localdomain>
- In-Reply-To
- <11659636263755-git-send-email-normalperson@yhbt.net>
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> --- git-svn.perl | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl index 1f8a3b0..aac8f73 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -2016,9 +2016,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}}) {
-- 1.4.4.2.g6f98