mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 04:34:46 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3a8359ac0 | ||
|
|
829e8fed8c | ||
|
|
c7e3605bff | ||
|
|
c1774b1596 |
No files matched your search
@@ -1,6 +1,10 @@
|
|||||||
CHANGELOG
|
CHANGELOG
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
1.2.1
|
||||||
|
-----
|
||||||
|
- Check errors when generating commit patch
|
||||||
|
|
||||||
1.2.0
|
1.2.0
|
||||||
-----
|
-----
|
||||||
- Added support for providing an alternate GitHub URL to support scanning GitHub Enteprise repositories
|
- Added support for providing an alternate GitHub URL to support scanning GitHub Enteprise repositories
|
||||||
|
|||||||
@@ -276,8 +276,8 @@ func getRepo() (Repo, error) {
|
|||||||
r *git.Repository
|
r *git.Repository
|
||||||
)
|
)
|
||||||
|
|
||||||
log.Infof("cloning %s", opts.Repo)
|
|
||||||
if opts.Disk {
|
if opts.Disk {
|
||||||
|
log.Infof("cloning %s", opts.Repo)
|
||||||
cloneTarget := fmt.Sprintf("%s/%x", dir, md5.Sum([]byte(fmt.Sprintf("%s%s", opts.GithubUser, opts.Repo))))
|
cloneTarget := fmt.Sprintf("%s/%x", dir, md5.Sum([]byte(fmt.Sprintf("%s%s", opts.GithubUser, opts.Repo))))
|
||||||
if opts.IncludePrivate {
|
if opts.IncludePrivate {
|
||||||
r, err = git.PlainClone(cloneTarget, false, &git.CloneOptions{
|
r, err = git.PlainClone(cloneTarget, false, &git.CloneOptions{
|
||||||
@@ -293,8 +293,10 @@ func getRepo() (Repo, error) {
|
|||||||
}
|
}
|
||||||
} else if opts.RepoPath != "" {
|
} else if opts.RepoPath != "" {
|
||||||
// use existing repo
|
// use existing repo
|
||||||
|
log.Infof("opening %s", opts.Repo)
|
||||||
r, err = git.PlainOpen(opts.RepoPath)
|
r, err = git.PlainOpen(opts.RepoPath)
|
||||||
} else {
|
} else {
|
||||||
|
log.Infof("cloning %s", opts.Repo)
|
||||||
if opts.IncludePrivate {
|
if opts.IncludePrivate {
|
||||||
r, err = git.Clone(memory.NewStorage(), nil, &git.CloneOptions{
|
r, err = git.Clone(memory.NewStorage(), nil, &git.CloneOptions{
|
||||||
URL: opts.Repo,
|
URL: opts.Repo,
|
||||||
@@ -351,7 +353,6 @@ func auditRef(r *git.Repository, ref *plumbing.Reference, commitWg *sync.WaitGro
|
|||||||
if prevCommit == nil {
|
if prevCommit == nil {
|
||||||
prevCommit = c
|
prevCommit = c
|
||||||
}
|
}
|
||||||
|
|
||||||
commitWg.Add(1)
|
commitWg.Add(1)
|
||||||
go func(c *object.Commit, prevCommit *object.Commit) {
|
go func(c *object.Commit, prevCommit *object.Commit) {
|
||||||
var (
|
var (
|
||||||
@@ -359,7 +360,15 @@ func auditRef(r *git.Repository, ref *plumbing.Reference, commitWg *sync.WaitGro
|
|||||||
filePath string
|
filePath string
|
||||||
skipFile bool
|
skipFile bool
|
||||||
)
|
)
|
||||||
patch, _ := c.Patch(prevCommit)
|
patch, err := c.Patch(prevCommit)
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf("problem generating patch for commit: %s\n", c.Hash.String())
|
||||||
|
if limitGoRoutines {
|
||||||
|
<-semaphore
|
||||||
|
}
|
||||||
|
commitChan <- leaks
|
||||||
|
return
|
||||||
|
}
|
||||||
for _, f := range patch.FilePatches() {
|
for _, f := range patch.FilePatches() {
|
||||||
skipFile = false
|
skipFile = false
|
||||||
from, to := f.Files()
|
from, to := f.Files()
|
||||||
|
|||||||
Reference in new issue
Block a user