fix git ref if ref not found in cache