gogits/gogs — pull request #298 by nuss-justin (2014-07-22 12:48:21+00:00)
Title: Fix issue #278. Fall back to (default) branch for context data, if no branch selected

This should fix #278.

If no branch was selected (ctx.Repo.BranchName is empty) fall back to default branch.
Also check if the default branch exists (being a little bit overcautious) and if not fall back to some other branch.