We need the code to work
* When the command is called from the toplevel ($git_prefix empty) or
not
* With --whole-tree or not
* With --build-dir (relative) or not
We do need to cd to the place in new/ corresponding to where the
command was called in the original repository to allow using
"$builddir/$mainbase".pdf as a relative path, but we need to compute
$builddir properly in all cases. This patch should do this.