Update `parse_git_dirty()` to support different versions of git