bundle: detect hash algorithm when reading refs