mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 12:44:22 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe8c6271f2 | ||
|
|
42fb085684 |
No files matched your search
@@ -1,6 +1,10 @@
|
|||||||
CHANGELOG
|
CHANGELOG
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
1.6.1
|
||||||
|
-----
|
||||||
|
- Recover from panic when diffing
|
||||||
|
|
||||||
1.6.0
|
1.6.0
|
||||||
-----
|
-----
|
||||||
- Default maximum goroutines spawned is number of cores your cpu run with. See benchmarks in wiki.
|
- Default maximum goroutines spawned is number of cores your cpu run with. See benchmarks in wiki.
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# Contributing Guidelines
|
||||||
|
|
||||||
|
The gitleaks project is under [GNU General Public License v3.0](LICENSE.md) and accepts
|
||||||
|
contributions via GitHub pull requests.
|
||||||
|
|
||||||
|
## How to Contribute
|
||||||
|
|
||||||
|
Open a PR. Give the PR a descriptive title. Add some comments describing whats the purpose of the PR.
|
||||||
|
|
||||||
|
__BUT before you do that!__
|
||||||
|
|
||||||
|
Make sure you pass this list of requirements.
|
||||||
|
|
||||||
|
- You've ran `go fmt`.
|
||||||
|
- You've ran `golint`.
|
||||||
|
- Your Go changes are confined to `gitleaks_test.go` and `main.go`. This is subject to change as the project evolves. Stylistically, I like having a single go file considering the size of this project (its tiny).
|
||||||
|
- You've added test cases for your changes.
|
||||||
|
- Your test pass.
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ type Config struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const defaultGithubURL = "https://api.github.com/"
|
const defaultGithubURL = "https://api.github.com/"
|
||||||
const version = "1.6.0"
|
const version = "1.6.1"
|
||||||
const defaultConfig = `
|
const defaultConfig = `
|
||||||
title = "gitleaks config"
|
title = "gitleaks config"
|
||||||
# add regexes to the regex table
|
# add regexes to the regex table
|
||||||
@@ -393,6 +393,14 @@ func auditRef(repo Repo, ref *plumbing.Reference, commitWg *sync.WaitGroup, comm
|
|||||||
filePath string
|
filePath string
|
||||||
skipFile bool
|
skipFile bool
|
||||||
)
|
)
|
||||||
|
defer func() {
|
||||||
|
<-semaphore
|
||||||
|
commitChan <- leaks
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
log.Warnf("recoverying from panic on commit %s, likely large diff causing panic", c.Hash.String())
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
if prevCommit == nil {
|
if prevCommit == nil {
|
||||||
t, _ := c.Tree()
|
t, _ := c.Tree()
|
||||||
files := t.Files()
|
files := t.Files()
|
||||||
@@ -406,16 +414,12 @@ func auditRef(repo Repo, ref *plumbing.Reference, commitWg *sync.WaitGroup, comm
|
|||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("problem generating diff for commit: %s\n", c.Hash.String())
|
log.Warnf("problem generating diff for commit: %s\n", c.Hash.String())
|
||||||
<-semaphore
|
|
||||||
commitChan <- leaks
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
patch, err := c.Patch(prevCommit)
|
patch, err := c.Patch(prevCommit)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("problem generating patch for commit: %s\n", c.Hash.String())
|
log.Warnf("problem generating patch for commit: %s\n", c.Hash.String())
|
||||||
<-semaphore
|
|
||||||
commitChan <- leaks
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, f := range patch.FilePatches() {
|
for _, f := range patch.FilePatches() {
|
||||||
@@ -445,8 +449,6 @@ func auditRef(repo Repo, ref *plumbing.Reference, commitWg *sync.WaitGroup, comm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<-semaphore
|
|
||||||
commitChan <- leaks
|
|
||||||
}(c, prevCommit)
|
}(c, prevCommit)
|
||||||
prevCommit = c
|
prevCommit = c
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in new issue
Block a user