updating readme and comments

This commit is contained in:
zricethezav committed 2020-02-01 16:48:05 -05:00
1 parent 2810eccc82
commit e7fbcf5333
2 files changed
+6 -3

No files matched your search

+1 -1
View File
@@ -64,6 +64,7 @@ Application Options:
--password= Password for git repo --password= Password for git repo
--access-token= Access token for git repo --access-token= Access token for git repo
--commit= sha of commit to audit --commit= sha of commit to audit
--files-at-commit= sha of commit to audit all files at commit
--threads= Maximum number of threads gitleaks spawns --threads= Maximum number of threads gitleaks spawns
--ssh-key= path to ssh key used for auth --ssh-key= path to ssh key used for auth
--uncommitted run gitleaks on uncommitted code --uncommitted run gitleaks on uncommitted code
@@ -90,7 +91,6 @@ Application Options:
Help Options: Help Options:
-h, --help Show this help message -h, --help Show this help message
``` ```
### Docker usage examples ### Docker usage examples
+5 -2
View File
@@ -257,6 +257,9 @@ func InspectString(content string, c *object.Commit, repo *Repo, filename string
type commitInspector func(c *object.Commit, repo *Repo) error type commitInspector func(c *object.Commit, repo *Repo) error
// inspectCommit accepts a commit hash, repo, and commit inspecting function. A new commit
// object will be created from the hash which will be passed into either inspectCommitPatches
// or inspectFilesAtCommit depending on the options set.
func inspectCommit(hash string, repo *Repo, f commitInspector) error { func inspectCommit(hash string, repo *Repo, f commitInspector) error {
h := plumbing.NewHash(hash) h := plumbing.NewHash(hash)
c, err := repo.CommitObject(h) c, err := repo.CommitObject(h)
@@ -301,8 +304,8 @@ func inspectCommitPatches(c *object.Commit, repo *Repo) error {
}) })
} }
// inspectFilesAtCommit accepts a commit object and a repo. This function is only called when the --commit= // inspectFilesAtCommit accepts a commit object and a repo. This function is only called when the --files-at-commit=
// option has been set. That option tells gitleaks to look only at a single commit and check the contents // option has been set. That option tells gitleaks to look only at ALL the files at a commit and check the contents
// of said commit. Similar to inspectPatch(), if the files contained in the commit are a binaries or if they are // of said commit. Similar to inspectPatch(), if the files contained in the commit are a binaries or if they are
// whitelisted then those files will be skipped. // whitelisted then those files will be skipped.
func inspectFilesAtCommit(c *object.Commit, repo *Repo) error { func inspectFilesAtCommit(c *object.Commit, repo *Repo) error {