ported from 'anything' to 'magit'.