mirror of
https://github.com/google/adb-sync.git
synced 2026-01-19 01:28:01 +00:00
If there is no path component at all, do append it to the destination.
This commit is contained in:
4
adb-sync
4
adb-sync
@@ -589,12 +589,14 @@ def FixPath(src, dst):
|
|||||||
# rsync-like path munging to make remote specifications shorter.
|
# rsync-like path munging to make remote specifications shorter.
|
||||||
pos = src.rfind(b'/')
|
pos = src.rfind(b'/')
|
||||||
if pos >= 0:
|
if pos >= 0:
|
||||||
if pos == len(src)-1:
|
if src.endswith(b'/'):
|
||||||
# Final slash: copy to the destination "as is".
|
# Final slash: copy to the destination "as is".
|
||||||
src = src[:-1]
|
src = src[:-1]
|
||||||
else:
|
else:
|
||||||
# No final slash: destination name == source name.
|
# No final slash: destination name == source name.
|
||||||
dst += src[pos:]
|
dst += src[pos:]
|
||||||
|
else:
|
||||||
|
dst += b'/' + src
|
||||||
return (src, dst)
|
return (src, dst)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user