From: Eric Wong Date: Sat, 12 Nov 2005 09:27:22 GMT Subject: [PATCH 2/5] archimport: don't die on merge-base failure Message-ID: <20051112092721.GC16218@Muzzle> In-Reply-To: <20051112092533.GB16218@Muzzle> Don't die if we can't find a merge base, Arch allows arbitrary cherry-picks between unrelated branches and we should not die when that happens Signed-off-by: Eric Wong --- git-archimport.perl | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) applies-to: 07dfd96ba53890d6a20fa0b028cf96e0e49bc027 7d099adadc041d74a0defc107656f273b35f57cb diff --git a/git-archimport.perl b/git-archimport.perl index 7c15184..699d5f6 100755 --- a/git-archimport.perl +++ b/git-archimport.perl @@ -693,7 +693,13 @@ sub find_parents { next unless -e "$git_dir/refs/heads/$branch"; my $mergebase = `git-merge-base $branch $ps->{branch}`; - die "Cannot find merge base for $branch and $ps->{branch}" if $?; + if ($?) { + # Don't die here, Arch supports one-way cherry-picking + # between branches with no common base (or any relationship + # at all beforehand) + warn "Cannot find merge base for $branch and $ps->{branch}"; + next; + } chomp $mergebase; # now walk up to the mergepoint collecting what patches we have --- 0.99.9.GIT