Ver Fonte

Merge pull request #3682 from milkey-mouse/set-prev-location-early

Set cache previous_location on load instead of save (fixes #3304)
TW há 7 anos atrás
pai
commit
adf9919d3e
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      src/borg/cache.py

+ 1 - 1
src/borg/cache.py

@@ -290,6 +290,7 @@ class CacheConfig:
             self.previous_location = recanonicalize_relative_location(previous_location, self.repository)
         else:
             self.previous_location = None
+        self._config.set('cache', 'previous_location', self.repository._location.canonical_path())
 
     def save(self, manifest=None, key=None):
         if manifest:
@@ -304,7 +305,6 @@ class CacheConfig:
             self._config.set('integrity', 'manifest', manifest.id_str)
         if key:
             self._config.set('cache', 'key_type', str(key.TYPE))
-        self._config.set('cache', 'previous_location', self.repository._location.canonical_path())
         with SaveFile(self.config_path) as fd:
             self._config.write(fd)