Skip to content

Commit 965fde2

Browse files
committed
ssh: fix ~ on Docker transport Copy
1 parent 36d4929 commit 965fde2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/agent/transport/docker/transport.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,10 @@ func (t *dockerTransport) Copy(localPath, remoteName string) error {
384384
}
385385
}
386386

387+
// Since we know the home directory via probing, trim ~/ from the remote name
388+
// if it was included.
389+
remoteName = strings.TrimPrefix(remoteName, "~/")
390+
387391
// Compute the path inside the container. We don't bother trimming trailing
388392
// slashes from the home directory, because both Windows and POSIX will work
389393
// in their presence. The only case on Windows where \\ has special meaning

0 commit comments

Comments
 (0)