Revert "Fixed detection of git branch."

This reverts commit 813b3660479777525113d7cb9ca8c664fb37e841.