mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
Reset commit values when auditing uncommitted changes
This commit is contained in:
1 parent
c04e137b28
commit
5152e1fc63
1 file changed
+6
@@ -104,6 +104,11 @@ func (repo *Repo) AuditUncommitted() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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()
|
prevTree, err := c.Tree()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -164,6 +169,7 @@ func (repo *Repo) AuditUncommitted() error {
|
|||||||
Commit: c.Hash.String(),
|
Commit: c.Hash.String(),
|
||||||
Repo: repo.Name,
|
Repo: repo.Name,
|
||||||
Rule: "file regex matched" + repo.config.FileRegex.String(),
|
Rule: "file regex matched" + repo.config.FileRegex.String(),
|
||||||
|
Message: c.Message,
|
||||||
Author: c.Author.Name,
|
Author: c.Author.Name,
|
||||||
Email: c.Author.Email,
|
Email: c.Author.Email,
|
||||||
Date: c.Author.When,
|
Date: c.Author.When,
|
||||||
|
|||||||
Reference in new issue
Block a user