1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

target/ssh: Fix improper use of os.path.basename()

os.path.basename() can give surprising results on folder names:

    os.path.basename('/foo/') == ''
    os.path.basename(os.path.normpath('/foo/')) == 'foo'
This commit is contained in:
douglas-raillard-arm 2020-06-18 12:26:26 +01:00 committed by Marc Bonnici
parent 2129d85422
commit 0c72763d2a

View File

@ -464,7 +464,7 @@ class SshConnection(SshConnectionBase):
# inside the destination folder, rather than merging the trees. # inside the destination folder, rather than merging the trees.
dst = os.path.join( dst = os.path.join(
dst, dst,
os.path.basename(src), os.path.basename(os.path.normpath(src)),
) )
return cls._push_folder_internal(sftp, src, dst) return cls._push_folder_internal(sftp, src, dst)