remap-rescan: prevent empty/damaged repos to break the remap operation.

This commit is contained in:
Marcin Kuzminski 2019-01-18 17:21:29 +01:00
parent 69933a19e6
commit f91d1b0d32

View file

@ -2276,7 +2276,7 @@ class Repository(Base, BaseModel):
# use no-cache version here
scm_repo = self.scm_instance(cache=False, config=config)
empty = scm_repo.is_empty()
empty = not scm_repo or scm_repo.is_empty()
if not empty:
cs_cache = scm_repo.get_commit(
pre_load=["author", "date", "message", "parents"])