Optimize the algorithm used to create the diff used to open a new PR
Here as well, we used to iterate through all the commits to find which
ones are present on the other branch. Now we just iterate through both
branch and stop when we encounter the first commit present in both
branches.
We will need to consolidate our code base a little as this is the first
time we are using a similar piece of code, so we definitively have
duplication here.