set HEAD then master as fallback branches

Hi Tim,

as git symbolic-ref could be directly run in a remote repository to modify the target of the HEAD symlink, maybe should it be checked before master in listFiles function.
And by the way, maybe the master branch should always be the last fallback branch.

Eric