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

Fix exception during "attic create" with repeated files

Closes #39
This commit is contained in:
Jonas Borgström 2014-02-16 22:37:12 +01:00
parent 32e773c15d
commit d44fa850cd
3 changed files with 8 additions and 1 deletions

View file

@ -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
------------

View file

@ -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

View file

@ -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)