diff --git a/CHANGES b/CHANGES index d0e6fe8e6..15ed5beb7 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,7 @@ Version 0.11 - New "check" command for repository consistency checking (#24) - Documentation improvements +- Fix exception during "attic create" with repeated files (#39) Version 0.10 ------------ diff --git a/attic/cache.py b/attic/cache.py index 62c4b725c..8c4a4caf3 100644 --- a/attic/cache.py +++ b/attic/cache.py @@ -206,7 +206,8 @@ def file_known_and_unchanged(self, path_hash, st): if (entry and entry[3] == st_mtime_ns(st) and entry[2] == st.st_size and entry[1] == st.st_ino): # reset entry age - self.files[path_hash][0] = 0 + if entry[0] != 0: + self.files[path_hash][0] = 0 return entry[4] else: return None diff --git a/attic/testsuite/archiver.py b/attic/testsuite/archiver.py index 72ef59864..43c770be7 100644 --- a/attic/testsuite/archiver.py +++ b/attic/testsuite/archiver.py @@ -179,6 +179,11 @@ def test_path_normalization(self): self.assert_not_in('..', output) self.assert_in(' input/dir1/dir2/file', output) + def test_repeated_files(self): + self.create_regual_file('file1', size=1024 * 80) + self.attic('init', self.repository_location) + self.attic('create', self.repository_location + '::test', 'input', 'input') + def test_overwrite(self): self.create_regual_file('file1', size=1024 * 80) self.create_regual_file('dir2/file2', size=1024 * 80)