1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-07 23:18:43 +00:00

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.
This commit is contained in:
Lauri Niskanen 2016-04-10 18:23:22 +03:00
parent c3e6bc2b7e
commit 9fc5df4a62
No known key found for this signature in database
GPG key ID: 807DCEAC3AEB1848

View file

@ -471,7 +471,7 @@ def compare_link(item1, item2):
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):