From 43a997529328c0ebbe50b79ccb6ad830abbcd983 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 31 Aug 2021 19:54:25 -0600 Subject: Fix that failing test --- cmd_command.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'cmd_command.go') diff --git a/cmd_command.go b/cmd_command.go index 819d6eb..5698efa 100644 --- a/cmd_command.go +++ b/cmd_command.go @@ -48,7 +48,7 @@ type CmdCommit struct { Merge []string } -func (c CmdCommit) fiCmdClass() cmdClass { return cmdClassCommand } +func (c CmdCommit) fiCmdClass(_ fiReaderState) cmdClass { return cmdClassCommand } func (c CmdCommit) fiCmdWrite(fiw fiWriter) error { ez := &ezfiw{fiw: fiw} @@ -93,6 +93,7 @@ func (CmdCommit) fiCmdRead(fir fiReader) (cmd Cmd, err error) { c.Mark, err = strconv.Atoi(trimLinePrefix(ez.ReadLine(), "mark :")) ez.Errcheck(err) } + fir.SetCommandMark(c.Mark) // original-oid? if strings.HasPrefix(ez.PeekLine(), "original-oid ") { @@ -152,7 +153,7 @@ func (CmdCommit) fiCmdRead(fir fiReader) (cmd Cmd, err error) { // Backend. type CmdCommitEnd struct{} -func (CmdCommitEnd) fiCmdClass() cmdClass { return cmdClassInCommit } +func (CmdCommitEnd) fiCmdClass(_ fiReaderState) cmdClass { return cmdClassInCommit } func (CmdCommitEnd) fiCmdWrite(fiw fiWriter) error { return nil } func (CmdCommitEnd) fiCmdRead(fir fiReader) (Cmd, error) { panic("not reached") } @@ -172,7 +173,7 @@ type CmdTag struct { Data string } -func (c CmdTag) fiCmdClass() cmdClass { return cmdClassCommand } +func (c CmdTag) fiCmdClass(_ fiReaderState) cmdClass { return cmdClassCommand } func (c CmdTag) fiCmdWrite(fiw fiWriter) error { ez := &ezfiw{fiw: fiw} @@ -249,7 +250,7 @@ type CmdReset struct { CommitIsh string // optional } -func (c CmdReset) fiCmdClass() cmdClass { return cmdClassCommand } +func (c CmdReset) fiCmdClass(_ fiReaderState) cmdClass { return cmdClassCommand } func (c CmdReset) fiCmdWrite(fiw fiWriter) error { ez := &ezfiw{fiw: fiw} @@ -289,7 +290,7 @@ type CmdBlob struct { Data string } -func (c CmdBlob) fiCmdClass() cmdClass { return cmdClassCommand } +func (c CmdBlob) fiCmdClass(_ fiReaderState) cmdClass { return cmdClassCommand } func (c CmdBlob) fiCmdWrite(fiw fiWriter) error { ez := &ezfiw{fiw: fiw} @@ -340,7 +341,7 @@ type CmdAlias struct { CommitIsh string } -func (c CmdAlias) fiCmdClass() cmdClass { return cmdClassCommand } +func (c CmdAlias) fiCmdClass(_ fiReaderState) cmdClass { return cmdClassCommand } func (c CmdAlias) fiCmdWrite(fiw fiWriter) error { ez := &ezfiw{fiw: fiw} ez.WriteLine("alias") @@ -379,7 +380,7 @@ func (CmdAlias) fiCmdRead(fir fiReader) (cmd Cmd, err error) { // CmdCheckpoint requests that the Backend flush already-sent data. type CmdCheckpoint struct{} -func (c CmdCheckpoint) fiCmdClass() cmdClass { return cmdClassCommand } +func (c CmdCheckpoint) fiCmdClass(_ fiReaderState) cmdClass { return cmdClassCommand } func (c CmdCheckpoint) fiCmdWrite(fiw fiWriter) error { return fiw.WriteLine("checkpoint") } @@ -400,7 +401,7 @@ type CmdProgress struct { Str string } -func (c CmdProgress) fiCmdClass() cmdClass { return cmdClassCommand } +func (c CmdProgress) fiCmdClass(_ fiReaderState) cmdClass { return cmdClassCommand } func (c CmdProgress) fiCmdWrite(fiw fiWriter) error { return fiw.WriteLine("progress", c.Str) } @@ -422,7 +423,7 @@ type CmdFeature struct { Argument string } -func (c CmdFeature) fiCmdClass() cmdClass { return cmdClassCommand } +func (c CmdFeature) fiCmdClass(_ fiReaderState) cmdClass { return cmdClassCommand } func (c CmdFeature) fiCmdWrite(fiw fiWriter) error { if c.Argument != "" { return fiw.WriteLine("feature", c.Feature+"="+c.Argument) @@ -456,7 +457,7 @@ type CmdOption struct { Option string } -func (c CmdOption) fiCmdClass() cmdClass { return cmdClassCommand } +func (c CmdOption) fiCmdClass(_ fiReaderState) cmdClass { return cmdClassCommand } func (c CmdOption) fiCmdWrite(fiw fiWriter) error { return fiw.WriteLine("option", c.Option) } @@ -476,7 +477,7 @@ func (CmdOption) fiCmdRead(fir fiReader) (cmd Cmd, err error) { // sent. type CmdDone struct{} -func (c CmdDone) fiCmdClass() cmdClass { return cmdClassCommand } +func (c CmdDone) fiCmdClass(_ fiReaderState) cmdClass { return cmdClassCommand } func (c CmdDone) fiCmdWrite(fiw fiWriter) error { return fiw.WriteLine("done") } -- cgit v1.2.3-54-g00ecf