if they are the same and dest is a directory, should error like cp behavior

Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
This commit is contained in:
zhangguanzhang 2020-10-03 17:24:40 +08:00
parent 69ef37be2a
commit 74e01d6ccd
2 changed files with 6 additions and 4 deletions

1
.gitignore vendored
View File

@ -9,6 +9,7 @@
*.test
.*.swp
.DS_Store
.idea*
# a .bashrc may be added to customize the build environment
.bashrc
.gopath/

View File

@ -1247,10 +1247,11 @@ func (archiver *Archiver) CopyFileWithTar(src, dst string) (err error) {
}()
options := &TarOptions{
UIDMaps: archiver.UntarIDMappings.UIDs(),
GIDMaps: archiver.UntarIDMappings.GIDs(),
ChownOpts: archiver.ChownOpts,
InUserNS: rsystem.RunningInUserNS(),
UIDMaps: archiver.UntarIDMappings.UIDs(),
GIDMaps: archiver.UntarIDMappings.GIDs(),
ChownOpts: archiver.ChownOpts,
InUserNS: rsystem.RunningInUserNS(),
NoOverwriteDirNonDir: true,
}
err = archiver.Untar(r, filepath.Dir(dst), options)
if err != nil {