فهرست منبع

Archive: Fix up tar commandline arguments in TarFilter()

There is no need to duplicate the compression flags for
every element in the filter.
Alexander Larsson 12 سال پیش
والد
کامیت
8f23945f7f
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      archive.go

+ 2 - 1
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:]...))
 }