summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2021-02-01 17:53:10 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2021-02-01 18:16:11 -0700
commit3115a98bdf713ff0f0f1c7e471cf452a48e466e8 (patch)
tree52d0916d7e56afc8a7442dd6bfe8fcdb260b1cf4
parent08829058a1d436a2c2fb9cee88ef13a3d30ae3d4 (diff)
Bring up to git.git commit f73b2aba05788208ccd9b48f350b90cbfe57e1c4
-rw-r--r--cmd_command.go10
1 files changed, 10 insertions, 0 deletions
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 <name> 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 <commit-ish> LF
if !strings.HasPrefix(ez.PeekLine(), "from ") {
ez.Errcheck(errors.Errorf("tag: expected from command: %v", ez.ReadLine()))