attr: push the bare repo check into read_attr()