jakubgarfield/Bonobo-Git-Server — pull request #38 by xieyubo (2013-06-07 06:06:23+00:00)
Title: Fix a crash issue if there is no master branch.

Repo step:
1. Create a project.
2. git push http://xxxxx.git master:test
3. Browse files from web.
4. Crash.

Root cause:
If the branch is not master, in RepositoryBrowser::TryGetBrunch(),
_repository.Head.Target will be null. _repository.Head.Target.Hash
will throw a null reference exception.

Fix:
if _repository.Head.Target is null, use the first branch as the default
branch.