729a8b4 fix git_head for detached head state

Authored and Committed by clime 3 years ago
    fix git_head for detached head state
    
    * this is the case after git checkout. Without this fix, repo was
    evaluated as dirty even though it wasn't (just in detached state).