diff --git a/commit.go b/commit.go index 07b7c37..d419af2 100644 --- a/commit.go +++ b/commit.go @@ -9,6 +9,7 @@ import "C" import ( "runtime" + "time" "unsafe" ) @@ -18,6 +19,10 @@ type Commit struct { cast_ptr *C.git_commit } +func (c Commit) Time() time.Time { + return time.Unix(int64(C.git_commit_time(c.cast_ptr)), 0) +} + func (c Commit) Message() string { return C.GoString(C.git_commit_message(c.cast_ptr)) }