Use checked-out branch as default branch.

Previously assumed 'master' was the default branch, when master may not
exist at all.
Attempt to fix test for repo without master branch.

Without a working test environment, it's hard to be confident it will
succeed, but it's certainly a step closer to correct.
Fix tests (and this time I tested it).

Admittedly, I tested it by modifying composer.json to include phpunit
but then did not commit that change, so it's vaguely possible an older
phpunit would find a way to fail.

I think we should be good, though.
Solving conflicts