1722e96bb0
If git repository HEAD points to a branch, use that as the default branch. Otherwise fall back to previous method.