make dirty state check work for older git versions