lock repo as function