1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-11-22 00:15:39 +00:00

compare: always diff "xattr" keys

Because of how xattr works (it will not be set on all files, but it's
possible for it to be added to a file without changing any other key)
it's necessary that we _always_ compute a diff when we hit an inode that
has xattr keys set.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
Aleksa Sarai 2016-12-17 20:14:17 +11:00
parent 0dc720e861
commit ad35cae482
No known key found for this signature in database
GPG key ID: 9E18AA267DDB8DB4

View file

@ -192,7 +192,7 @@ func compareEntry(oldEntry, newEntry Entry) ([]KeyDelta, error) {
for _, kv := range oldKeys { for _, kv := range oldKeys {
key := kv.Keyword() key := kv.Keyword()
// only add this diff if the new keys has this keyword // only add this diff if the new keys has this keyword
if key != "tar_time" && key != "time" && HasKeyword(newKeys, key) == emptyKV { if key != "tar_time" && key != "time" && key != "xattr" && HasKeyword(newKeys, key) == emptyKV {
continue continue
} }
@ -211,7 +211,7 @@ func compareEntry(oldEntry, newEntry Entry) ([]KeyDelta, error) {
for _, kv := range newKeys { for _, kv := range newKeys {
key := kv.Keyword() key := kv.Keyword()
// only add this diff if the old keys has this keyword // only add this diff if the old keys has this keyword
if key != "tar_time" && key != "time" && HasKeyword(oldKeys, key) == emptyKV { if key != "tar_time" && key != "time" && key != "xattr" && HasKeyword(oldKeys, key) == emptyKV {
continue continue
} }