mirror of
https://github.com/docker/cli.git
synced 2026-01-19 21:41:31 +03:00
Archive: Fix up tar commandline arguments in TarFilter()
There is no need to duplicate the compression flags for every element in the filter. Upstream-commit: 8f23945f7f666e3151890de90ebb39db3c7f5ada Component: engine
This commit is contained in:
committed by
Victor Vieux
parent
5f5630fd65
commit
1fb4f4dbcf
@@ -90,8 +90,9 @@ func TarFilter(path string, compression Compression, filter []string) (io.Reader
|
||||
if filter == nil {
|
||||
filter = []string{"."}
|
||||
}
|
||||
args = append(args, "-c"+compression.Flag())
|
||||
for _, f := range filter {
|
||||
args = append(args, "-c"+compression.Flag(), f)
|
||||
args = append(args, f)
|
||||
}
|
||||
return CmdStream(exec.Command(args[0], args[1:]...))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user