Use GIT_ATTR_CHECK_FILE_THEN_INDEX.