From fe97df5b5843862d8303cd92586065920e8639f6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 16 Nov 2017 17:08:02 -0500 Subject: s/UserTime/Ident/ --- commands.go | 6 +++--- frontend.go | 2 +- textproto/types.go | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/commands.go b/commands.go index 5085ed8..7e7c4f3 100644 --- a/commands.go +++ b/commands.go @@ -13,8 +13,8 @@ type Cmd interface { type CmdCommit struct { Ref string Mark int // optional; < 1 for non-use - Author *textproto.UserTime - Committer textproto.UserTime + Author *textproto.Ident + Committer textproto.Ident Msg string From string Merge []string @@ -57,7 +57,7 @@ func (c CmdCommit) fiWriteCmd(fiw *textproto.FIWriter) error { type CmdTag struct { RefName string CommitIsh string - Tagger textproto.UserTime + Tagger textproto.Ident Data string } diff --git a/frontend.go b/frontend.go index c08e1b8..8282bb7 100644 --- a/frontend.go +++ b/frontend.go @@ -233,7 +233,7 @@ func (f *Frontend) parse() error { if !strings.HasPrefix(line, "tagger ") { return fmt.Errorf("tag: expected tagger command: %v", line) } - c.Tagger, err = textproto.ParseUserTime(trimLinePrefix(line, "tagger ")) + c.Tagger, err = textproto.ParseIdent(trimLinePrefix(line, "tagger ")) if err != nil { return err } diff --git a/textproto/types.go b/textproto/types.go index 9a1731b..dd4c48d 100644 --- a/textproto/types.go +++ b/textproto/types.go @@ -9,13 +9,13 @@ import ( // BUG(lukeshu): Only supports the "raw" date format (not "rfc2822" or // "now") -type UserTime struct { +type Ident struct { Name string Email string Time time.Time } -func (ut UserTime) String() string { +func (ut Ident) String() string { if ut.Name == "" { return fmt.Sprintf("<%s> %d %s", ut.Name, @@ -31,8 +31,8 @@ func (ut UserTime) String() string { } } -func ParseUserTime(str string) (UserTime, error) { - ret := UserTime{} +func ParseIdent(str string) (Ident, error) { + ret := Ident{} lt := strings.IndexAny(str, "<>") if lt < 0 || str[lt] != '<' { return ret, fmt.Errorf("Missing < in ident string: %v", str) -- cgit v1.2.3-2-g168b