Don't call _is_dirty() if allow_dirty is set

There is no need for the `git status --porcelain` call if the user explicitly stated that he wants to ignore the dirty flag.