summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Waldmann <tw@waldmann-edv.de>2023-06-27 18:40:48 +0200
committerThomas Waldmann <tw@waldmann-edv.de>2023-06-27 18:40:48 +0200
commit45aa88dbeca5350e4cb09e90027f6bf45b48e32f (patch)
tree7d0c24ac57c47dc4f541a6445a2f7a5d1e11dbfd /src
parentf73eb5c6c2c1428d6c0186602dc8bc28fcd7f34d (diff)
--files-cache=size: fix crash, fixes #7658
Diffstat (limited to 'src')
-rw-r--r--src/borg/cache.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/borg/cache.py b/src/borg/cache.py
index d304f4408..b0ff5e541 100644
--- a/src/borg/cache.py
+++ b/src/borg/cache.py
@@ -1046,6 +1046,9 @@ class LocalCache(CacheStatsMixin):
elif 'm' in cache_mode:
cmtime_type = 'mtime'
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(age=0, inode=st.st_ino, size=st.st_size, cmtime=int_to_bigint(cmtime_ns), chunk_ids=ids)
self.files[path_hash] = msgpack.packb(entry)
self._newest_cmtime = max(self._newest_cmtime or 0, cmtime_ns)