Fix annoying "fatal: bad revision '^master'" git error

On some buildbots and friends, we don't have remotes as you normally think of them.  Provide a fallback for $origin in that case.