Check whether repo exists when download repo