Skip to content

Commit 8a4f42d

Browse files
delete: compute archive_formatted before archive deletion, see #9416
here it was not a problem currently, because format_archive(archive_info) does not load the archive from the repo, but only uses the given archive_info contents.
1 parent 3c204c3 commit 8a4f42d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/borg/archiver/delete_cmd.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def do_delete(self, args, repository):
3636
logger_list = logging.getLogger("borg.output.list")
3737
for i, archive_info in enumerate(archive_infos, 1):
3838
name, id, hex_id = archive_info.name, archive_info.id, bin_to_hex(archive_info.id)
39+
# format early before deletion of the archive
40+
archive_formatted = format_archive(archive_info)
3941
try:
4042
# this does NOT use Archive.delete, so this code hopefully even works in cases a corrupt archive
4143
# would make the code in class Archive crash, so the user can at least get rid of such archives.
@@ -47,7 +49,7 @@ def do_delete(self, args, repository):
4749
deleted = True
4850
if self.output_list:
4951
msg = "Would delete: {} ({}/{})" if dry_run else "Deleted archive: {} ({}/{})"
50-
logger_list.info(msg.format(format_archive(archive_info), i, count))
52+
logger_list.info(msg.format(archive_formatted, i, count))
5153
if dry_run:
5254
logger.info("Finished dry-run.")
5355
elif deleted:

0 commit comments

Comments
 (0)