Merge pull request #266 from pre-commit/fix_no_commit_to_branch

Fix no-commit-to-branch when not on a branch