@@ -16,7 +16,6 @@ package source
1616import (
1717 "path/filepath"
1818 "sync"
19- "time"
2019
2120 "github.com/bep/gitmap"
2221 "github.com/gohugoio/hugo/common/hashing"
@@ -154,50 +153,5 @@ func NewFileInfo(fi hugofs.FileMetaInfo) *File {
154153 }
155154}
156155
157- func NewGitInfo (info gitmap.GitInfo ) GitInfo {
158- gi := GitInfo {
159- Hash : info .Hash ,
160- AbbreviatedHash : info .AbbreviatedHash ,
161- Subject : info .Subject ,
162- AuthorName : info .AuthorName ,
163- AuthorEmail : info .AuthorEmail ,
164- AuthorDate : info .AuthorDate ,
165- CommitDate : info .CommitDate ,
166- Body : info .Body ,
167- }
168-
169- if info .Ancestor != nil {
170- anc := NewGitInfo (* info .Ancestor )
171- gi .Ancestor = & anc
172- }
173-
174- return gi
175- }
176-
177156// GitInfo provides information about a version controlled source file.
178- type GitInfo struct {
179- // Commit hash.
180- Hash string `json:"hash"`
181- // Abbreviated commit hash.
182- AbbreviatedHash string `json:"abbreviatedHash"`
183- // The commit message's subject/title line.
184- Subject string `json:"subject"`
185- // The author name, respecting .mailmap.
186- AuthorName string `json:"authorName"`
187- // The author email address, respecting .mailmap.
188- AuthorEmail string `json:"authorEmail"`
189- // The author date.
190- AuthorDate time.Time `json:"authorDate"`
191- // The commit date.
192- CommitDate time.Time `json:"commitDate"`
193- // The commit message's body.
194- Body string `json:"body"`
195- // The file-filtered ancestor commit, if any.
196- Ancestor * GitInfo `json:"ancestor"`
197- }
198-
199- // IsZero returns true if the GitInfo is empty,
200- // meaning it will also be falsy in the Go templates.
201- func (g * GitInfo ) IsZero () bool {
202- return g == nil || g .Hash == ""
203- }
157+ type GitInfo = gitmap.GitInfo
0 commit comments