diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-11-24 12:21:55 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-11-24 12:33:03 -0500 |
commit | 221873029a6166acaba1fef37508f9f1544180cd (patch) | |
tree | 8fedd9d27d25c0591e2f60468670335a4ded9a25 /cmd_command.go | |
parent | 4a566395874113e38b5785fc5e436c96c001b032 (diff) |
clean up textproto; move types.go into libfastimport
Diffstat (limited to 'cmd_command.go')
-rw-r--r-- | cmd_command.go | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cmd_command.go b/cmd_command.go index c6e7080..b004488 100644 --- a/cmd_command.go +++ b/cmd_command.go @@ -4,8 +4,6 @@ import ( "fmt" "strconv" "strings" - - "git.lukeshu.com/go/libfastimport/textproto" ) // commit ////////////////////////////////////////////////////////////////////// @@ -13,8 +11,8 @@ import ( type CmdCommit struct { Ref string Mark int // optional; < 1 for non-use - Author *textproto.Ident - Committer textproto.Ident + Author *Ident + Committer Ident Msg string From string Merge []string @@ -58,7 +56,7 @@ func (CmdCommit) fiCmdRead(fir fiReader) (cmd Cmd, err error) { // ('author' (SP <name>)? SP LT <email> GT SP <when> LF)? if strings.HasPrefix(ez.PeekLine(), "author ") { - author, err := textproto.ParseIdent(trimLinePrefix(ez.ReadLine(), "author ")) + author, err := ParseIdent(trimLinePrefix(ez.ReadLine(), "author ")) ez.Errcheck(err) c.Author = &author } @@ -67,7 +65,7 @@ func (CmdCommit) fiCmdRead(fir fiReader) (cmd Cmd, err error) { if !strings.HasPrefix(ez.PeekLine(), "committer ") { ez.Errcheck(fmt.Errorf("commit: expected committer command: %v", ez.ReadLine())) } - c.Committer, err = textproto.ParseIdent(trimLinePrefix(ez.ReadLine(), "committer ")) + c.Committer, err = ParseIdent(trimLinePrefix(ez.ReadLine(), "committer ")) ez.Errcheck(err) // data @@ -99,7 +97,7 @@ func (CmdCommitEnd) fiCmdRead(fir fiReader) (Cmd, error) { panic("not reached") type CmdTag struct { RefName string CommitIsh string - Tagger textproto.Ident + Tagger Ident Data string } @@ -132,7 +130,7 @@ func (CmdTag) fiCmdRead(fir fiReader) (cmd Cmd, err error) { if !strings.HasPrefix(ez.PeekLine(), "tagger ") { ez.Errcheck(fmt.Errorf("tag: expected tagger command: %v", ez.ReadLine())) } - c.Tagger, err = textproto.ParseIdent(trimLinePrefix(ez.ReadLine(), "tagger ")) + c.Tagger, err = ParseIdent(trimLinePrefix(ez.ReadLine(), "tagger ")) ez.Errcheck(err) // data |