From 931930c001ffb8ac7c88414bcb0f1913e4681d63 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 1 Feb 2021 17:39:57 -0700 Subject: Bring up to git.git commit cf7b857a77bda6a9a93e2cde2f6ae1764e7a2517 --- cmd.go | 2 ++ cmd_comment.go | 9 ++++++++- frontend.go | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cmd.go b/cmd.go index d1358a8..7582b47 100644 --- a/cmd.go +++ b/cmd.go @@ -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 -- cgit v1.2.3