Reset commit values when auditing uncommitted changes

This commit is contained in:
Peter Gallagher999 committed 2019-11-28 23:13:59 +00:00
1 parent c04e137b28
commit 5152e1fc63
1 file changed
+6
+6
View File
@@ -104,6 +104,11 @@ func (repo *Repo) AuditUncommitted() error {
if err != nil {
return err
}
c.Hash = plumbing.Hash{}
c.Message = "STAGED CHANGES"
c.Author.Name = ""
c.Author.Email = ""
c.Author.When = time.Now()
prevTree, err := c.Tree()
if err != nil {
@@ -164,6 +169,7 @@ func (repo *Repo) AuditUncommitted() error {
Commit: c.Hash.String(),
Repo: repo.Name,
Rule: "file regex matched" + repo.config.FileRegex.String(),
Message: c.Message,
Author: c.Author.Name,
Email: c.Author.Email,
Date: c.Author.When,