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 <normalperson@yhbt.net> Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Eric Wong committed
Nov 12, 2005 at 01:27 UTC
9b626e752eebcc49acab19085947e67b5e61e39f
1 file changed
+7
-1
git-archimport.perl
+7
-1
@@ -692,7 +692,13 @@ sub find_parents {
692
next unless -e "$git_dir/refs/heads/$branch";
693
694
my $mergebase = `git-merge-base $branch $ps->{branch}`;
695
- die "Cannot find merge base for $branch and $ps->{branch}" if $?;
695
+ if ($?) {
696
+ # Don't die here, Arch supports one-way cherry-picking
697
+ # between branches with no common base (or any relationship
698
+ # at all beforehand)
699
+ warn "Cannot find merge base for $branch and $ps->{branch}";
700
+ next;
701
+ }
702
chomp $mergebase;
703
704
# now walk up to the mergepoint collecting what patches we have