From b86f67126c86a07aac155f38aefd6c1ef538e24d Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 5 Sep 2013 20:11:18 +0200 Subject: [PATCH] Archive: Fix up tar commandline arguments in TarFilter() There is no need to duplicate the compression flags for every element in the filter. --- archive.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/archive.go b/archive.go index bb019fb033..80b305a418 100644 --- a/archive.go +++ b/archive.go @@ -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:]...)) }