Handle repos with wonky origin.

By making our own ref for master, we avoid issues where origin/master
is stale.