Superconductivity in repulsively interacting fermions on a diamond chain: Flat-band-induced pairing