1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-27 02:08:54 +00:00

--files-cache=size: fix crash, fixes #7658

This commit is contained in:
Thomas Waldmann 2023-06-27 18:40:48 +02:00
parent 4326813c05
commit ec1f2dfbf1
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01

View file

@ -1049,6 +1049,9 @@ def memorize_file(self, hashed_path, path_hash, st, ids):
elif "m" in cache_mode: elif "m" in cache_mode:
cmtime_type = "mtime" cmtime_type = "mtime"
cmtime_ns = safe_ns(st.st_mtime_ns) cmtime_ns = safe_ns(st.st_mtime_ns)
else: # neither 'c' nor 'm' in cache_mode, avoid UnboundLocalError
cmtime_type = "ctime"
cmtime_ns = safe_ns(st.st_ctime_ns)
entry = FileCacheEntry( entry = FileCacheEntry(
age=0, inode=st.st_ino, size=st.st_size, cmtime=int_to_timestamp(cmtime_ns), chunk_ids=ids age=0, inode=st.st_ino, size=st.st_size, cmtime=int_to_timestamp(cmtime_ns), chunk_ids=ids
) )