-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gitleaks exits with exit code 0 when ambiguous argument to log-opts are provided #722
Gitleaks exits with exit code 0 when ambiguous argument to log-opts are provided #722
Comments
I'm not able to reproduce this behavior:
This chunk of code is responsible for catching errors coming from I suppose what could be happening is the goroutine that continues the main execution finishes before the error can be scanned. |
Just kidding, stdout is blocked if I remove the goroutine invocation. A simple hack would be to add a sleep timer for like 100 ms which would give the stderr scanner enough time to check for errors. I think I'll introduce that |
@JoostVoskuil please try |
Awesome, can't reproduce this anymore. You are really fast @zricethezav , can't keep up haha |
@zricethezav maybe we should just use channel to sync instead of using time.Sleep hack? |
@L11r that would be ideal! Once upon a time I tried to implement that but failed. Happy to accept a community PR if someone wants to give it a shot |
@zricethezav I've prepared a draft PR: #1250! Also would be nice if you review those ones: #1242 and #1249 |
Describe the bug
Gitleaks exits with exit code 0 when ambiguous argument to log-opts are provided
To Reproduce
Run Gitleaks with log-opts that triggers an error from git log
Expected behavior
When error occurs I would expect exit code 1
** Logging**
8:47AM ERR fatal: ambiguous argument '18ee779d989c28192f5d439a91bcbbd3bf11dac2^..ffc5f83a4f995ed146c27fa32227ddfff251f282': unknown revision or path not in the working tree.
8:47AM ERR Use '--' to separate paths from revisions, like this:
8:47AM ERR 'git [...] -- [...]'
8:47AM INF no leaks found
8:47AM INF scan completed in 30.9416ms
Basic Info (please complete the following information):
The text was updated successfully, but these errors were encountered: