summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2021-02-01 17:39:57 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2021-02-01 18:16:11 -0700
commit931930c001ffb8ac7c88414bcb0f1913e4681d63 (patch)
tree0f18c81da59d77a047ece179b3a8e7cad18ddec5
parentb7bd3adf84ed5f5c18b659973a0539d611a61230 (diff)
Bring up to git.git commit cf7b857a77bda6a9a93e2cde2f6ae1764e7a2517
-rw-r--r--cmd.go2
-rw-r--r--cmd_comment.go9
-rw-r--r--frontend.go4
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