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

Merge pull request #6694 from ThomasWaldmann/versions-mount-1archive-error-master

mount -o versions: give clear error msg instead of crashing
This commit is contained in:
TW 2022-05-15 19:52:32 +02:00 committed by GitHub
commit ab4bef0372
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,7 +35,7 @@ def async_wrapper(fn):
from .archiver import Archiver
from .archive import Archive, get_item_uid_gid
from .hashindex import FuseVersionsIndex
from .helpers import daemonize, daemonizing, hardlinkable, signal_handler, format_file_size
from .helpers import daemonize, daemonizing, hardlinkable, signal_handler, format_file_size, Error
from .helpers import msgpack
from .item import Item
from .lrucache import LRUCache
@ -272,6 +272,9 @@ def __init__(self, key, manifest, repository, args, decrypted_repository):
def _create_filesystem(self):
self._create_dir(parent=1) # first call, create root dir (inode == 1)
if self._args.location.archive:
if self.versions:
raise Error("for versions view, do not specify a single archive, "
"but always give the repository as location.")
self._process_archive(self._args.location.archive)
else:
self.versions_index = FuseVersionsIndex()