diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-02-19 06:09:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-19 06:09:22 -0500 |
commit | 6a9257a292f034d2576b78913c0d555b936b4963 (patch) | |
tree | 296a9c359010dcab03b82f44da74352ecec06ed1 /cmd/podman | |
parent | 1c6c94d44a207e42eddf9b863c20e5004021f3af (diff) | |
parent | 71689052a1a70c10171607bdc6d75a4985f8565a (diff) | |
download | podman-6a9257a292f034d2576b78913c0d555b936b4963.tar.gz podman-6a9257a292f034d2576b78913c0d555b936b4963.tar.bz2 podman-6a9257a292f034d2576b78913c0d555b936b4963.zip |
Merge pull request #9428 from vrothberg/cp-content-fix
cp: treat "." and "/." correctly
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/containers/cp.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/podman/containers/cp.go b/cmd/podman/containers/cp.go index 69b61a06c..5db05719c 100644 --- a/cmd/podman/containers/cp.go +++ b/cmd/podman/containers/cp.go @@ -311,8 +311,8 @@ func copyToContainer(container string, containerPath string, hostPath string) er } getOptions := buildahCopiah.GetOptions{ - // Unless the specified path ends with ".", we want to copy the base directory. - KeepDirectoryNames: !strings.HasSuffix(hostPath, "."), + // Unless the specified points to ".", we want to copy the base directory. + KeepDirectoryNames: hostInfo.IsDir && filepath.Base(hostPath) != ".", } if !hostInfo.IsDir && (!containerInfo.IsDir || containerInfoErr != nil) { // If we're having a file-to-file copy, make sure to |