strip: factor out update target selection
The same algorithm was used in two places: one to find out which commit shall
become the parent of wdir, and the other to prepare the wdir when keeping
changes. Factoring it out prevents inconsistent changes in either occurrence.
#require docutils gettext
$ $TESTDIR/check-gendoc it
checking for parse errors