rebase -i -p: refactor the preparation for -p into its own function
This is another cleanup to make the code more readable: it separates
the parts that handle the initializations necessary for -p from the
rest.
They cannot be put into a single function, as part of the intialization
has to be performed before generating the rebase script, and another
part uses the rebase script to determine which commits will be picked,
and therefore has to be called when the rebase script exists
already.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>