1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 01:06:50 +00:00

make borg check work for empty repo

This commit is contained in:
Thomas Waldmann 2016-06-05 01:22:43 +02:00
parent 7501c3b530
commit 6a70d9968c

View file

@ -695,7 +695,12 @@ def init_chunks(self):
self.chunks[id_] = (0, 0, 0)
def identify_key(self, repository):
cdata = repository.get(next(self.chunks.iteritems())[0])
try:
some_chunkid, _ = next(self.chunks.iteritems())
except StopIteration:
# repo is completely empty, no chunks
return None
cdata = repository.get(some_chunkid)
return key_factory(repository, cdata)
def rebuild_manifest(self):