Support detached heads and non-git-enabled folders