def _is_dirty(dir_path):
    """Check whether a git repository has uncommitted changes."""
    try:
        subprocess.check_call(["git", "diff", "--quiet"], cwd=dir_path)
        return False
    except subprocess.CalledProcessError:
        return True
def _is_dirty ( dir_path ) : try : subprocess . check_call ( [ "git" , "diff" , "--quiet" ] , cwd = dir_path ) return False except subprocess . CalledProcessError : return True
Check whether a git repository has uncommitted changes.