1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 17:27:31 +00:00

Merge pull request #7036 from ThomasWaldmann/fix-7034-master

check: fix uninitialised variable if repo is completely empty, fixes #7034
This commit is contained in:
TW 2022-09-17 21:22:43 +02:00 committed by GitHub
commit 7e3b6752cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1081,6 +1081,7 @@ def report_error(msg):
pi = ProgressIndicatorPercent( pi = ProgressIndicatorPercent(
total=segment_count, msg="Checking segments %3.1f%%", step=0.1, msgid="repository.check" total=segment_count, msg="Checking segments %3.1f%%", step=0.1, msgid="repository.check"
) )
segment = -1 # avoid uninitialized variable if there are no segment files at all
for i, (segment, filename) in enumerate(self.io.segment_iterator()): for i, (segment, filename) in enumerate(self.io.segment_iterator()):
pi.show(i) pi.show(i)
if segment <= last_segment_checked: if segment <= last_segment_checked: