From 7b02b85a66fee6b357e02f9e70dd0baa0fd24308 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 8 Sep 2007 16:33:08 -0700 Subject: git-svn: understand grafts when doing dcommit Use the rev-list --parents functionality to read the parents of the commit. cat-file only shows the raw object with the original parents and doesn't take into account grafts; so we'll rely on rev-list machinery for the smarts here. Signed-off-by: Eric Wong Signed-off-by: Junio C Hamano --- git-svn.perl | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/git-svn.perl b/git-svn.perl index fbd4691bc..f8181609f 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -841,14 +841,9 @@ sub working_head_info { sub read_commit_parents { my ($parents, $c) = @_; - my ($fh, $ctx) = command_output_pipe(qw/cat-file commit/, $c); - while (<$fh>) { - chomp; - last if ''; - /^parent ($sha1)/ or next; - push @{$parents->{$c}}, $1; - } - close $fh; # break the pipe + chomp(my $p = command_oneline(qw/rev-list --parents -1/, $c)); + $p =~ s/^($c)\s*// or die "rev-list --parents -1 $c failed!\n"; + @{$parents->{$c}} = split(/ /, $p); } sub linearize_history { -- cgit v1.2.1