Skip to content

Commit

Permalink
git-svn: understand grafts when doing dcommit
Browse files Browse the repository at this point in the history
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 <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Eric Wong authored and Junio C Hamano committed Sep 9, 2007
1 parent 5701115 commit 7b02b85
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7b02b85

Please sign in to comment.