diff options
-rw-r--r-- | cmd.go | 2 | ||||
-rw-r--r-- | cmd_comment.go | 9 | ||||
-rw-r--r-- | frontend.go | 4 |
3 files changed, 12 insertions, 3 deletions
@@ -26,6 +26,8 @@ // // A program can read commands from a frontend by wrapping the // appropriate io.Reader with a Frontend object. +// +// This is up-to-date with full syntax supported by git v2.22.0. package libfastimport type fiReader interface { diff --git a/cmd_comment.go b/cmd_comment.go index 8c812f4..684c92b 100644 --- a/cmd_comment.go +++ b/cmd_comment.go @@ -55,7 +55,14 @@ type CmdGetMark struct { Mark int } -func (c CmdGetMark) fiCmdClass() cmdClass { return cmdClassComment } +func (c CmdGetMark) fiCmdClass() cmdClass { + // Prior to git v2.22.0 this was 'cmdClassComment', but in + // v2.22.0 it was changed to a stricter + // 'cmdClassCommand|cmdClassInCommit'. I want to have better + // backward compatibility, so I'm keeping it as + // 'cmdClassComment'. + return cmdClassComment +} func (c CmdGetMark) fiCmdWrite(fiw fiWriter) error { return fiw.WriteLine("get-mark", ":"+strconv.Itoa(c.Mark)) } diff --git a/frontend.go b/frontend.go index 5ae6bd9..e920a1e 100644 --- a/frontend.go +++ b/frontend.go @@ -41,8 +41,8 @@ func (e UnsupportedCommand) Error() string { // The parser is a bit more forgiving than git's own parser. It // allows extra newlines anywhere it allows comments, whereas git's // own parser is quite strict about newlines. It allows 'cat-blob' -// commands anywhere it allows comments, which git used to allow, but -// was made stricter in git v2.22.0. +// and 'get-mark' commands anywhere it allows comments, which git used +// to allow, but was made stricter in git v2.22.0. type Frontend struct { fastImport *parser catBlobWrite *textproto.CatBlobWriter |