tools/pipbot: Refactor finish to use git API

Issue #193.