mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 07:04:24 +00:00
075f8c67a5
When normalizing the git source config, the base and head refs should be normalized to commit hashes, in case a branch or tag name was used. The `resolveAndSetCommit` function was returning a boolean value which should indicate whether the input ref was changed from its original value. While this is in itself not a problem, the caller (`normalizeConfig`) was using this boolean as an error marker, and returning early in case of `false`. This meant that if the config was already containing a commit hash for the base or head ref, `resolveAndSetCommit` would set the flag to `false` and `normalizeConfig` would early return erreneously. This caused the logic to find the ancestor commit to be skipped which caused the bug in the issue #3220. Since the `resolveAndSetCommit` function was only used in `normalizeConfig`, the signature has been changed to only return the commit object and an error. The check for early return in `normalizeConfig` now instead relies on the commit object being `nil` to indicate a failure to resolve the ref. Refs: #3220 |
||
---|---|---|
.. | ||
circleci | ||
docker | ||
elasticsearch | ||
filesystem | ||
gcs | ||
git | ||
github | ||
github_experimental | ||
gitlab | ||
huggingface | ||
jenkins | ||
postman | ||
s3 | ||
syslog | ||
travisci | ||
chunker.go | ||
chunker_test.go | ||
errors.go | ||
errors_test.go | ||
job_progress.go | ||
job_progress_hook.go | ||
job_progress_test.go | ||
legacy_reporters.go | ||
metrics.go | ||
mock_job_progress_test.go | ||
resume.go | ||
resume_test.go | ||
source_manager.go | ||
source_manager_test.go | ||
source_unit.go | ||
sources.go | ||
sources_test.go | ||
test_helpers.go |