Explorar o código

Fix 'borg diff' when symlink is replacing or being replaced

Previously on some cases where symlink replaced something else or was replaced
by something else, `borg diff` failed with `KeyError: b'source'`. This commit
fixes the issue.
Lauri Niskanen %!s(int64=9) %!d(string=hai) anos
pai
achega
9fc5df4a62
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      borg/archiver.py

+ 1 - 1
borg/archiver.py

@@ -471,7 +471,7 @@ class Archiver:
                 return 'added link'
             elif item2.get(b'deleted'):
                 return 'removed link'
-            elif item1[b'source'] != item2[b'source']:
+            elif b'source' in item1 and b'source' in item2 and item1[b'source'] != item2[b'source']:
                 return 'changed link'
 
         def contents_changed(item1, item2):