1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-29 11:16:43 +00:00

win32: do not test for ctime difference

ctime is file creation time on windows and is not updated on "touch".
This commit is contained in:
Thomas Waldmann 2024-10-05 20:30:40 +02:00
parent 64e7095578
commit 1e4314f367
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01

View file

@ -173,7 +173,9 @@ def get_changes(filename, data):
unexpected = {"type": "modified", "added": 0, "removed": 0}
assert unexpected not in get_changes("input/file_touched", joutput)
if not content_only:
assert {"ctime", "mtime"}.issubset({c["type"] for c in get_changes("input/file_touched", joutput)})
# on win32, ctime is the file creation time and does not change.
expected = {"mtime"} if is_win32 else {"mtime", "ctime"}
assert expected.issubset({c["type"] for c in get_changes("input/file_touched", joutput)})
else:
# And if we're doing content-only, don't show the file at all.
assert not any(get_changes("input/file_touched", joutput))