eth0izzle / shhgit

Ah shhgit! Find secrets in your code. Secrets detection for your GitHub, GitLab and Bitbucket repositories.
MIT License
3.83k stars 481 forks source link

Fix exit code when no matches found #82

Closed orlangure closed 3 years ago

orlangure commented 3 years ago

This commit fixes 2 related issues:

  1. GetContentsMatches of pattern matches never returns nil, but sometimes it returns an empty slice. So the condition was changed, while maintaining BC (nil slice's length is still 0)
  2. matchedAny should not be set to true for every matched file. Instead, it should be set only if there is an actual problem reported in this file.
eth0izzle commented 3 years ago

Good catch. Merged!