Fix error if not exist "master".

It should fix gitlab problem.
See https://github.com/gitlabhq/gitlabhq/issues/1268