mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 12:14:22 +01:00
chdir for local repo mode
This commit is contained in:
1 parent
9f3ae4efa0
commit
7bbf07e7e6
1 file changed
+4
@@ -111,6 +111,10 @@ func (repo *Repo) audit() (bool, error) {
|
||||
}
|
||||
} else {
|
||||
log.Printf("fetching \x1b[37;1m%s\x1b[0m from %s ...\n", repo.name, repo.path)
|
||||
err = os.Chdir(fmt.Sprintf(repo.path))
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("cannot navigate to %s", repo.path)
|
||||
}
|
||||
err = exec.Command("git", "fetch").Run()
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("cannot fetch %s from %s", repo.url, repo.path)
|
||||
|
||||
Reference in new issue
Block a user