mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Archive: Fix up tar commandline arguments in TarFilter()
There is no need to duplicate the compression flags for every element in the filter.
This commit is contained in:
parent
8e8ef7cb5b
commit
8f23945f7f
1 changed files with 2 additions and 1 deletions
|
@ -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:]...))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue