diff --git a/commands/command_clean.go b/commands/command_clean.go index b2b4f0b8..8d5ec6fa 100644 --- a/commands/command_clean.go +++ b/commands/command_clean.go @@ -18,7 +18,7 @@ import ( // // If the object read from "from" is _already_ a clean pointer, then it will be // written out verbatim to "to", without trying to make it a pointer again. -func clean(from io.Reader, to io.Writer, fileName string) error { +func clean(to io.Writer, from io.Reader, fileName string) error { var cb progress.CopyCallback var file *os.File var fileSize int64 @@ -92,7 +92,7 @@ func cleanCommand(cmd *cobra.Command, args []string) { fileName = args[0] } - if err := clean(os.Stdin, os.Stdout, fileName); err != nil { + if err := clean(os.Stdout, os.Stdin, fileName); err != nil { Error(err.Error()) } } diff --git a/commands/command_filter_process.go b/commands/command_filter_process.go index b5b39814..2580cb56 100644 --- a/commands/command_filter_process.go +++ b/commands/command_filter_process.go @@ -34,7 +34,7 @@ var filterSmudgeSkip bool // This function, unlike the implementation found in the legacy smudge command, // only combines the `io.Reader`s when necessary, since the implementation // found in `*git.PacketReader` blocks while waiting for the following packet. -func filterSmudge(from io.Reader, to io.Writer, filename string) error { +func filterSmudge(to io.Writer, from io.Reader, filename string) error { var pbuf bytes.Buffer from = io.TeeReader(from, &pbuf) @@ -85,10 +85,10 @@ Scan: switch req.Header["command"] { case "clean": w = git.NewPktlineWriter(os.Stdout, cleanFilterBufferCapacity) - err = clean(req.Payload, w, req.Header["pathname"]) + err = clean(w, req.Payload, req.Header["pathname"]) case "smudge": w = git.NewPktlineWriter(os.Stdout, smudgeFilterBufferCapacity) - err = filterSmudge(req.Payload, w, req.Header["pathname"]) + err = filterSmudge(w, req.Payload, req.Header["pathname"]) default: fmt.Errorf("Unknown command %s", cmd) break Scan