mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 04:04:25 +01:00
Allow use of --repo-config for AuditUncommitted function
This commit is contained in:
1 parent
d9a060a12d
commit
9b3342fbff
1 file changed
+9
@@ -84,6 +84,15 @@ func (repo *Repo) Clone(cloneOption *git.CloneOptions) error {
|
||||
// AuditUncommitted will do a `git diff` and scan changed files that are being tracked. This is useful functionality
|
||||
// for a pre-commit hook so you can make sure your code does not have any leaks before committing.
|
||||
func (repo *Repo) AuditUncommitted() error {
|
||||
// load up alternative config if possible, if not use manager's config
|
||||
if repo.Manager.Opts.RepoConfig {
|
||||
cfg, err := repo.loadRepoConfig()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
repo.config = cfg
|
||||
}
|
||||
|
||||
auditTimeStart := time.Now()
|
||||
|
||||
r, err := repo.Head()
|
||||
|
||||
Reference in new issue
Block a user