From: Eric Wong Date: Sat, 12 Nov 2005 09:27:21 +0000 (-0800) Subject: archimport: don't die on merge-base failure X-Git-Tag: v0.99.9k~2^2~6^2~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=9b626e752eebcc49acab19085947e67b5e61e39f;p=git.git archimport: don't die on merge-base failure 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 Signed-off-by: Martin Langhoff --- diff --git a/git-archimport.perl b/git-archimport.perl index b7c1fbf0..d8e6f4e4 100755 --- a/git-archimport.perl +++ b/git-archimport.perl @@ -692,7 +692,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