Git poll 3

This pull request supersedes #1009.

This branch improves upon the previous branch in the following ways:

* It store lastRev branch names in non-bare form (`refs/heads/mybranch` instead of `mybranch`), for compatibility with earlier versions of the implementation. @djmitche Can you confirm that this is a valid correction to this issue?
* It also fixes some PEP8 warnings.