Skip to content

Commit 2a9794b

Browse files
authored
Merge pull request #68 from metwork-framework/move_or_copy_fix
fix: fix move_or_copy feature when src and dst are not on the same FS
2 parents 1abd60d + ec60b79 commit 2a9794b

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

layers/layer1_python3/0200_xattrfile/tests/test_basic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ def os_rename_fake(old_os_rename, src_exception, dst_exception,
189189
self.assertTrue(os.path.isfile(tmp_data_file_path2))
190190
self.assertEquals(make_xattrfile(
191191
tmp_data_file_path2).tags['key1'], b'value1')
192+
self.assertEquals(y.tags['key1'], b'value1')
192193
make_xattrfile(tmp_data_file_path2).delete()
193194

194195
def test_14_hardlink_or_copy(self):

layers/layer1_python3/0200_xattrfile/xattrfile/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,8 @@ def _hardlink_move_or_copy(self, new_filepath, hardlink_mode=True,
521521
self.copy(new_filepath, tmp_suffix=tmp_suffix,
522522
chmod_mode_int=chmod_mode_int)
523523
self.delete()
524+
self.__set_filepath(new_filepath)
525+
self._read_tags()
524526
return (True, False)
525527
except Exception:
526528
if hardlink_mode:

0 commit comments

Comments
 (0)