From 3115a98bdf713ff0f0f1c7e471cf452a48e466e8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 1 Feb 2021 17:53:10 -0700 Subject: Bring up to git.git commit f73b2aba05788208ccd9b48f350b90cbfe57e1c4 --- cmd_command.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd_command.go b/cmd_command.go index a326524..9249e75 100644 --- a/cmd_command.go +++ b/cmd_command.go @@ -149,6 +149,7 @@ func (CmdCommitEnd) fiCmdRead(fir fiReader) (Cmd, error) { panic("not reached") // Hint: Use CmdReset to create a *lightweight* tag. type CmdTag struct { RefName string + Mark int // optional; < 1 for non-use CommitIsh string OriginalOID string // optional Tagger Ident @@ -160,6 +161,9 @@ func (c CmdTag) fiCmdWrite(fiw fiWriter) error { ez := &ezfiw{fiw: fiw} ez.WriteLine("tag", c.RefName) + if c.Mark > 0 { + ez.WriteMark(c.Mark) + } ez.WriteLine("from", c.CommitIsh) if c.OriginalOID != "" { ez.WriteLine("original-oid", c.OriginalOID) @@ -177,6 +181,12 @@ func (CmdTag) fiCmdRead(fir fiReader) (cmd Cmd, err error) { // 'tag' SP LF c := CmdTag{RefName: trimLinePrefix(ez.ReadLine(), "tag ")} + // mark? + if strings.HasPrefix(ez.PeekLine(), "mark :") { + c.Mark, err = strconv.Atoi(trimLinePrefix(ez.ReadLine(), "mark :")) + ez.Errcheck(err) + } + // 'from' SP LF if !strings.HasPrefix(ez.PeekLine(), "from ") { ez.Errcheck(errors.Errorf("tag: expected from command: %v", ez.ReadLine())) -- cgit v1.2.3-54-g00ecf